/// <summary> /// Activates the destination scene /// </summary> protected virtual IEnumerator DestinationSceneActivation() { yield return(MMCoroutine.WaitForFrames(1)); MMLoadingSceneDebug("MMLoadingSceneManagerAdditive : activating destination scene"); MMSceneLoadingManager.LoadingSceneEvent.Trigger(_sceneToLoadName, MMSceneLoadingManager.LoadingStatus.DestinationSceneActivation); OnDestinationSceneActivation?.Invoke(); _loadDestinationAsyncOperation.allowSceneActivation = true; while (_loadDestinationAsyncOperation.progress < 1.0f) { yield return(null); } }
/// <summary> /// Waits and triggers state change and events /// </summary> protected virtual IEnumerator TimedActivationSequence() { if (DelayMode == DelayModes.Time) { yield return(MMCoroutine.WaitFor(TimeBeforeStateChange)); } else { yield return(StartCoroutine(MMCoroutine.WaitForFrames(FrameCount))); } StateChange(); Activate(); }
/// <summary> /// Enables the camera, either via enabled state or priority /// </summary> /// <param name="state"></param> /// <param name="frames"></param> /// <returns></returns> protected virtual IEnumerator EnableCamera(bool state, int frames) { if (VirtualCamera == null) { yield break; } if (frames > 0) { yield return(MMCoroutine.WaitForFrames(frames)); } if (Mode == Modes.Enable) { VirtualCamera.enabled = state; } else if (Mode == Modes.Priority) { VirtualCamera.Priority = state ? EnabledPriority : DisabledPriority; } }