private void Start() { FadeManager.AssertIsInitialized(); fadeControl = FadeManager.Instance; // If our FadeManager is missing, or if we're on the HoloLens // Remove this component. #if UNITY_2017_2_OR_NEWER if (!XRDevice.isPresent || #if UNITY_WSA !HolographicSettings.IsDisplayOpaque || #endif fadeControl == null) #else if (VRDevice.isPresent || fadeControl == null) #endif { Destroy(this); return; } if (teleportMarker != null) { teleportMarker = Instantiate(teleportMarker); teleportMarker.SetActive(false); animationController = teleportMarker.GetComponentInChildren <Animator>(); if (animationController != null) { animationController.StopPlayback(); } } }
private void Start() { // If we're on the HoloLens or no device is present, // remove this component. #if UNITY_2017_2_OR_NEWER if (!XRDevice.isPresent #if UNITY_WSA || !HolographicSettings.IsDisplayOpaque #endif ) #else if (VRDevice.isPresent) #endif { Destroy(this); return; } // FadeManager isn't checked unless we're in a // setup where it might be supported. FadeManager.AssertIsInitialized(); fadeControl = FadeManager.Instance; // If the FadeManager is missing, // remove this component. if (fadeControl == null) { Destroy(this); return; } if (teleportMarker != null) { teleportMarker = Instantiate(teleportMarker); teleportMarker.transform.parent = transform; teleportMarker.SetActive(false); animationController = teleportMarker.GetComponentInChildren <Animator>(); if (animationController != null) { animationController.StopPlayback(); } } }