private IEnumerator LoadLevelCo(SceneInfo nextSceneInfo, bool forceReload = false) { isLoading = true; yield return(new WaitForEndOfFrame()); nextSceneInfo.LoadLevel(forceReload); isLoading = false; }
private IEnumerator LoadLevelCo(SceneInfo nextSceneInfo, bool forceReload = false) { isLoading = true; yield return(new WaitForEndOfFrame()); nextSceneInfo.LoadLevel(forceReload); isLoading = false; StartCoroutine(OnCompleteSceneChange()); }
private IEnumerator LoadLevelCo(SceneInfo nextSceneInfo, bool forceReload = false) { isLoading = true; yield return(new WaitForEndOfFrame()); nextSceneInfo.LoadLevel(forceReload); isLoading = false; if (KickStarter.eventManager != null) { KickStarter.eventManager.Call_OnAfterChangeScene(); } }
private IEnumerator LoadLoadingScreen(SceneInfo nextSceneInfo, SceneInfo loadingSceneInfo, bool loadAsynchronously = false) { if (preloadSceneInfo != null) { ACDebug.LogWarning("Cannot use preloaded scene '" + preloadSceneInfo.GetLabel() + "' because the loading scene overrides it - discarding preloaded data."); } preloadAsync = null; preloadSceneInfo = new SceneInfo("", -1); isLoading = true; loadingProgress = 0f; loadingSceneInfo.LoadLevel(); yield return(null); if (KickStarter.player != null) { KickStarter.player.transform.position += new Vector3(0f, -10000f, 0f); } PrepareSceneForExit(true, false); if (loadAsynchronously) { if (KickStarter.settingsManager.loadingDelay > 0f) { float waitForTime = Time.realtimeSinceStartup + KickStarter.settingsManager.loadingDelay; while (Time.realtimeSinceStartup < waitForTime) { yield return(null); } } AsyncOperation aSync = nextSceneInfo.LoadLevelASync(); if (KickStarter.settingsManager.loadingDelay > 0f) { aSync.allowSceneActivation = false; while (aSync.progress < 0.9f) { loadingProgress = aSync.progress; yield return(null); } isLoading = false; float waitForTime = Time.realtimeSinceStartup + KickStarter.settingsManager.loadingDelay; while (Time.realtimeSinceStartup < waitForTime) { yield return(null); } aSync.allowSceneActivation = true; } else { while (!aSync.isDone) { loadingProgress = aSync.progress; yield return(null); } } KickStarter.stateHandler.IgnoreNavMeshCollisions(); } else { nextSceneInfo.LoadLevel(); } isLoading = false; StartCoroutine(OnCompleteSceneChange()); }
private IEnumerator LoadLoadingScreen(SceneInfo nextSceneInfo, SceneInfo loadingSceneInfo, bool loadAsynchronously = false) { isLoading = true; loadingProgress = 0f; loadingSceneInfo.LoadLevel(); yield return(null); if (KickStarter.player != null) { KickStarter.player.transform.position += new Vector3(0f, -10000f, 0f); } PrepareSceneForExit(true, false); if (loadAsynchronously) { yield return(new WaitForSeconds(KickStarter.settingsManager.loadingDelay)); AsyncOperation aSync = null; if (nextSceneInfo.Matches(preloadSceneInfo)) { aSync = preloadAsync; } else { aSync = nextSceneInfo.LoadLevelASync(); } if (KickStarter.settingsManager.loadingDelay > 0f) { aSync.allowSceneActivation = false; while (aSync.progress < 0.9f) { loadingProgress = aSync.progress; yield return(null); } isLoading = false; yield return(new WaitForSeconds(KickStarter.settingsManager.loadingDelay)); aSync.allowSceneActivation = true; } else { while (!aSync.isDone) { loadingProgress = aSync.progress; yield return(null); } } KickStarter.stateHandler.GatherObjects(); } else { nextSceneInfo.LoadLevel(); } isLoading = false; preloadAsync = null; preloadSceneInfo = new SceneInfo("", -1); if (KickStarter.eventManager != null) { KickStarter.eventManager.Call_OnAfterChangeScene(); } }
private IEnumerator LoadLoadingScreen(SceneInfo nextSceneInfo, SceneInfo loadingSceneInfo, bool loadAsynchronously = false) { isLoading = true; loadingProgress = 0f; if (KickStarter.player != null) { KickStarter.player.transform.position += new Vector3 (0f, -10000f, 0f); } loadingSceneInfo.LoadLevel (); yield return null; PrepareSceneForExit (true, false); if (loadAsynchronously) { yield return new WaitForSeconds (KickStarter.settingsManager.loadingDelay); AsyncOperation aSync = null; if (nextSceneInfo.Matches (preloadSceneInfo)) { aSync = preloadAsync; } else { aSync = nextSceneInfo.LoadLevelASync (); } if (KickStarter.settingsManager.loadingDelay > 0f) { aSync.allowSceneActivation = false; while (aSync.progress < 0.9f) { loadingProgress = aSync.progress; yield return null; } isLoading = false; yield return new WaitForSeconds (KickStarter.settingsManager.loadingDelay); aSync.allowSceneActivation = true; } else { while (!aSync.isDone) { loadingProgress = aSync.progress; yield return null; } } KickStarter.stateHandler.GatherObjects (); } else { nextSceneInfo.LoadLevel (); } isLoading = false; preloadAsync = null; preloadSceneInfo = new SceneInfo ("", -1); }
private IEnumerator LoadLevel(SceneInfo nextSceneInfo) { isLoading = true; yield return new WaitForEndOfFrame (); nextSceneInfo.LoadLevel (); isLoading = false; }
private IEnumerator LoadLevelCo(SceneInfo nextSceneInfo, bool forceReload = false) { isLoading = true; yield return new WaitForEndOfFrame (); nextSceneInfo.LoadLevel (forceReload); isLoading = false; }
private IEnumerator LoadLoadingScreen(SceneInfo nextSceneInfo, SceneInfo loadingSceneInfo, bool loadAsynchronously = false) { isLoading = true; loadingProgress = 0f; loadingSceneInfo.LoadLevel(); yield return(null); if (KickStarter.player != null) { KickStarter.player.transform.position += new Vector3(0f, -10000f, 0f); } PrepareSceneForExit(true, false); if (loadAsynchronously) { if (KickStarter.settingsManager.loadingDelay > 0f) { float waitForTime = Time.realtimeSinceStartup + KickStarter.settingsManager.loadingDelay; while (Time.realtimeSinceStartup < waitForTime) { yield return(null); } } AsyncOperation aSync = null; if (nextSceneInfo.Matches(preloadSceneInfo)) { aSync = preloadAsync; } else { aSync = nextSceneInfo.LoadLevelASync(); } if (KickStarter.settingsManager.loadingDelay > 0f) { aSync.allowSceneActivation = false; while (aSync.progress < 0.9f) { loadingProgress = aSync.progress; yield return(null); } isLoading = false; if (KickStarter.settingsManager.loadingDelay > 0f) { float waitForTime = Time.realtimeSinceStartup + KickStarter.settingsManager.loadingDelay; while (Time.realtimeSinceStartup < waitForTime) { yield return(null); } } aSync.allowSceneActivation = true; } else { while (!aSync.isDone) { loadingProgress = aSync.progress; yield return(null); } } KickStarter.stateHandler.IgnoreNavMeshCollisions(); } else { nextSceneInfo.LoadLevel(); } isLoading = false; preloadAsync = null; preloadSceneInfo = new SceneInfo("", -1); StartCoroutine(OnCompleteSceneChange()); }