private void OnDisable() { if (passThroughSystem != null) { passThroughSystem.Stop(); } loader = null; passThroughSystem = null; cameraTexLeft = null; cameraTexRight = null; }
void OnEnable() { loader = XRGeneralSettings.Instance.Manager.activeLoader as PXR_Loader; if (loader == null) { Debug.LogError("Has no XR loader in the project!"); return; } passThroughSystem = loader.GetLoadedSubsystem <PXR_PassThroughSystem>(); if (passThroughSystem == null) { Debug.LogError("Has no XR Camera subsystem !"); return; } passThroughSystem.Start(); }