Ejemplo n.º 1
0
    // implements AirVRCameraRigManager.EventHandler
    public void AirVRCameraRigWillBeBound(AirVRClientConfig config, List <AirVRCameraRig> availables, out AirVRCameraRig selected)
    {
        selected = null;

        if (availables.Count == 2)
        {
            foreach (AirVRCameraRig cameraRig in availables)
            {
                if (cameraRig.transform.parent.name.Equals("AirVRSamplePrimaryPlayer"))
                {
                    selected = cameraRig;
                    break;
                }
            }
        }
        else if (availables.Count == 1)
        {
            selected = availables[0];
        }

        if (selected)
        {
            AirVRSamplePlayer player = selected.GetComponentInParent <AirVRSamplePlayer>();
            player.EnableInteraction(true);

            if (getBoundCameraRigCount() == 0)
            {
                music.Play();
            }
            display.AddCameraPane(selected as AirVRStereoCameraRig);
        }
    }
Ejemplo n.º 2
0
    public void AirVRCameraRigHasBeenUnbound(AirVRCameraRig cameraRig)
    {
        AirVRSamplePlayer player = cameraRig.GetComponentInParent <AirVRSamplePlayer>();

        player.EnableInteraction(false);

        music.Stop();
    }
Ejemplo n.º 3
0
    // implements AirVRCameraRigManager.EventHandler
    public void AirVRCameraRigWillBeBound(int clientHandle, AirVRClientConfig config, List <AirVRCameraRig> availables, out AirVRCameraRig selected)
    {
        selected = availables.Count > 0 ? availables[0] : null;

        if (selected)
        {
            AirVRSamplePlayer player = selected.GetComponentInParent <AirVRSamplePlayer>();
            player.EnableInteraction(true);

            music.Play();
        }
    }
Ejemplo n.º 4
0
    public void AirVRCameraRigHasBeenUnbound(AirVRCameraRig cameraRig)
    {
        AirVRSamplePlayer player = cameraRig.GetComponentInParent <AirVRSamplePlayer>();

        player.EnableInteraction(false);

        if (getBoundCameraRigCount() == 0)
        {
            music.Stop();
        }
        display.RemoveCameraPane(cameraRig as AirVRStereoCameraRig);
    }
Ejemplo n.º 5
0
    public void AirVRCameraRigHasBeenUnbound(AirVRCameraRig cameraRig)
    {
        // NOTE : This event occurs in OnDestroy() of AirVRCameraRig during unloading scene.
        //        You should be careful because some objects in the scene might be destroyed already on this event.
        if (_sceneBeingUnloaded == false)
        {
            AirVRSamplePlayer player = cameraRig.GetComponentInParent <AirVRSamplePlayer>();
            player.EnableInteraction(false);

            music.Stop();
        }
    }