private void OnMRDeviceStatus(bool connected)
        {
            Debug.Log("MR Device status: " + (connected ? "connected" : "disconnected"));

            if (connected)
            {
                VarjoPluginMR.StartRender();
                SetClearColorSolidColor();
            }
            else
            {
                SetClearColorSkybox();
                VarjoPluginMR.StopRender();
            }
        }
示例#2
0
 void UpdateVideoSeeThrough()
 {
     if (videoSeeThrough != videoSeeThroughEnabled)
     {
         if (videoSeeThrough)
         {
             videoSeeThrough = VarjoPluginMR.StartRender();
         }
         else
         {
             VarjoPluginMR.StopRender();
         }
         videoSeeThroughEnabled = videoSeeThrough;
     }
 }
        void Start()
        {
            // Register to receive event notifications.
            VarjoManager.OnDataStreamStartEvent        += OnDataStreamStart;
            VarjoManager.OnDataStreamStopEvent         += OnDataStreamStop;
            VarjoManager.OnMRCameraPropertyChangeEvent += OnCameraPropertyChange;
            VarjoManager.OnMRDeviceStatusEvent         += OnMRDeviceStatus;

            // Try to start rendering. If there is no MR support available, this call fails and we
            // fall back to Skybox as the background.
            if (VarjoPluginMR.StartRender())
            {
                SetClearColorSolidColor();
            }
            else
            {
                SetClearColorSkybox();
            }
        }