예제 #1
0
        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;
     }
 }
예제 #3
0
        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();
            }
        }