Esempio n. 1
0
        private void OnEnable()
        {
            StartCoroutine(RenderLoop());
            SteamVR_Events.InputFocus.Listen(OnInputFocus);
            SteamVR_Events.System(EVREventType.VREvent_RequestScreenshot).Listen(OnRequestScreenshot);

            if (SteamVR_Settings.instance.legacyMixedRealityCamera)
            {
                SteamVR_ExternalCamera_LegacyManager.SubscribeToNewPoses();
            }

#if UNITY_2017_1_OR_NEWER
            Application.onBeforeRender += OnBeforeRender;
#else
            Camera.onPreCull += OnCameraPreCull;
#endif

            if (SteamVR.initializedState == SteamVR.InitializedStates.InitializeSuccess)
            {
                OpenVR.Screenshots.HookScreenshot(screenshotTypes);
            }
            else
            {
                SteamVR_Events.Initialized.AddListener(OnSteamVRInitialized);
            }
        }
Esempio n. 2
0
 private void OnEnable()
 {
     base.StartCoroutine(this.RenderLoop());
     SteamVR_Events.InputFocus.Listen(new UnityAction <bool>(this.OnInputFocus));
     SteamVR_Events.System(EVREventType.VREvent_RequestScreenshot).Listen(new UnityAction <VREvent_t>(this.OnRequestScreenshot));
     if (SteamVR_Settings.instance.legacyMixedRealityCamera)
     {
         SteamVR_ExternalCamera_LegacyManager.SubscribeToNewPoses();
     }
     Application.onBeforeRender += this.OnBeforeRender;
     Camera.onPreCull            = (Camera.CameraCallback)Delegate.Combine(Camera.onPreCull, new Camera.CameraCallback(this.OnCameraPreCull));
     if (SteamVR.initializedState == SteamVR.InitializedStates.InitializeSuccess)
     {
         OpenVR.Screenshots.HookScreenshot(this.screenshotTypes);
         return;
     }
     SteamVR_Events.Initialized.AddListener(new UnityAction <bool>(this.OnSteamVRInitialized));
 }
        private void OnEnable()
        {
            MelonCoroutines.Start(RenderLoop());
            SteamVR_Events.InputFocus.Listen((this.OnInputFocus));
            SteamVR_Events.System(EVREventType.VREvent_RequestScreenshot).Listen((this.OnRequestScreenshot));
            if (SteamVR_Settings.instance.legacyMixedRealityCamera)
            {
                SteamVR_ExternalCamera_LegacyManager.SubscribeToNewPoses();
            }

            UnityHooks.OnBeforeRender += OnBeforeRender;
            UnityHooks.OnBeforeCull   += OnCameraPreCull;
            if (SteamVR.initializedState == SteamVR.InitializedStates.InitializeSuccess)
            {
                OpenVR.Screenshots.HookScreenshot(this.screenshotTypes);
                return;
            }
            SteamVR_Events.Initialized.Listen(this.OnSteamVRInitialized);
        }