private void onCutsceneLoaded(string cutsceneAdditiveScene, additiveCompleteDelegate onCompleteCallBack) { if (decrementLoadCount(cutsceneAdditiveScene) <= 0) { handleCutsceneLoaded(currentCutsceneEvent); onCompleteCallBack(); } }
private void loadDecorations(additiveLoadDelegate onLoadCallBack, additiveCompleteDelegate onCompleteCallBack) { ScheduledDecorationData[] decorationData = currentCutsceneEvent.DecorationData; foreach (ScheduledDecorationData scheduledDecorationData in decorationData) { if (!string.IsNullOrEmpty(scheduledDecorationData.DecorationAdditiveScene)) { incrementLoadCount(scheduledDecorationData.DecorationAdditiveScene, isDecoration: true); CoroutineRunner.Start(loadAdditiveScene(scheduledDecorationData.DecorationAdditiveScene, onLoadCallBack, onCompleteCallBack), this, "loadAdditiveScene"); } else { Log.LogError(this, $"Error: {base.gameObject.GetPath()} has a Decoration data field with a null scene entry"); } } }
private void loadCutscene(additiveLoadDelegate onLoadCallBack, additiveCompleteDelegate onCompleteCallBack) { ScheduledCutSceneData cutsceneData = currentCutsceneEvent.CutsceneData; if (!string.IsNullOrEmpty(currentCutsceneEvent.CutsceneData.CutSceneAdditiveScene)) { string text = createLocalKey(cutsceneData.PlayedKeyName); if (string.IsNullOrEmpty(text) || (!string.IsNullOrEmpty(text) && !PlayerPrefs.HasKey(text))) { incrementLoadCount(cutsceneData.CutSceneAdditiveScene, isDecoration: false); CoroutineRunner.Start(loadAdditiveScene(cutsceneData.CutSceneAdditiveScene, onLoadCallBack, onCompleteCallBack), this, "loadAdditiveScene"); } else { onCompleteCallBack(); } } else { Log.LogError(this, $"Error: {base.gameObject.GetPath()} has a Cutscene data field with a null scene entry"); } }
private IEnumerator loadAdditiveScene(string additiveScene, additiveLoadDelegate onLoadCallBack, additiveCompleteDelegate onCompleteCallBack) { if (!string.IsNullOrEmpty(additiveScene)) { Service.Get <LoadingController>().AddLoadingSystem(this); additiveSceneTimer = new Stopwatch(); additiveSceneTimer.Start(); yield return(SceneManager.LoadSceneAsync(additiveScene, LoadSceneMode.Additive)); Service.Get <LoadingController>().RemoveLoadingSystem(this); additiveSceneTimer.Stop(); onLoadCallBack?.Invoke(additiveScene, onCompleteCallBack); } }