private void ClipReload() { string clipName = currentClipName; atLeastOneLoop = true; this.TimeDelayCall(() => { if (currentClipName == clipName) { UnloadCurrentClip(); this.RealtimeDelayCall(() => { if (currentClipName == clipName) { LoadLiveClip(clipName); SetReadyText(); } }, 0.1f); } }, Mathf.Max(currentClip.postDelay, 0.1f)); // reason for this value: 0.07f is slightly longer than the 0.05f delay // from a few lines up float epsilon = 0.07f; float delayBeforeFade = currentClip.postDelay / 4; float totalTransitionDuration = Mathf.Max(delayBeforeFade + epsilon, 0.1f); this.TimeDelayCall( () => TransitionUtility.OneShotFadeTransition(totalTransitionDuration * 2, totalTransitionDuration * 3), delayBeforeFade * .3f); }
private IEnumerator Clips() { runningLiveClips = true; StartListeningForPlayers(); GameManager.NotificationManager.CallOnMessage(Message.RecordingFinished, () => { if (!clipReloadThisFrame) { ClipReload(); clipReloadThisFrame = true; this.FrameDelayCall(() => clipReloadThisFrame = false, 3); } }); GameManager.NotificationManager.CallOnMessage(Message.RecordingInterrupt, SubclipInterrupt); yield return(null); ySkip.StartListening(); foreach (LiveClipInfo liveClip in liveClips) { clipReloadThisFrame = false; currentClip = liveClip; ResetCheckin(); currentClipName = liveClip.clipName; currentSubclips = liveClip.subclipInfo; yield return(new WaitForSecondsRealtime(liveClip.preDelay)); LoadLiveClip(currentClipName); yield return(null); while (!AllCheckedIn() && !ySkip.AllCheckedIn()) { yield return(null); } yield return(null); TransitionUtility.OneShotFadeTransition(0.3f, 0.2f); yield return(new WaitForSecondsRealtime(0.15f)); UnloadCurrentClip(); yield return(null); if (ySkip.AllCheckedIn()) { break; } } TransitionUtility.OneShotFadeTransition(0.1f, 0.4f); yield return(new WaitForSeconds(0.05f)); runningLiveClips = false; if (ySkip.AllCheckedIn()) { PlayerTutorial.SkipTutorial(); } else { SceneStateManager.instance.Load(Scene.Sandbox); } }