Topic: Synchronization Panoramas

In some cases, you may need to achieve that Pan, Tilt and FOV of several panoramas changed synchronously.
Using this script you can do this:

using InfinityCode.uPano;
using UnityEngine;

public class SyncPanoViews : MonoBehaviour
{
    public Pano[] panoramas;
    private bool ignoreEvents;

    private void Start()
    {
        foreach (Pano pano in panoramas)
        {
            pano.OnPanChanged += OnPanChanged;
            pano.OnTiltChanged += OnTiltChanged;
            pano.OnFOVChanged += OnFovChanged;
        }
    }

    private void OnFovChanged(float fov)
    {
        if (ignoreEvents) return;

        ignoreEvents = true;
        foreach (Pano pano in panoramas) pano.fov = fov;
        ignoreEvents = false;
    }

    private void OnTiltChanged(float tilt)
    {
        if (ignoreEvents) return;

        ignoreEvents = true;
        foreach (Pano pano in panoramas) pano.tilt = tilt;
        ignoreEvents = false;
    }

    private void OnPanChanged(float pan)
    {
        if (ignoreEvents) return;

        ignoreEvents = true;
        foreach (Pano pano in panoramas) pano.pan = pan;
        ignoreEvents = false;
    }
}
Kind Regards,
Infinity Code Team.

uContext is Editor PowerPack (more than 50 tools) that take your workflow in Unity Editor to a next level, simplifies working with content, adds new features, corrects and improves the editor’s built-in behaviors. Click here to download uContext Basic for free.