IEnumerator LoadCurrentScene(string sceneName, bool LoadScreen = false, bool LoadNeighbor = false, Action OnEnd = null) { currentScene = sceneName; if (!IsLoaded(currentScene)) { yield return(LoadAsyncAdditive(sceneName, LoadScreen, LoadNeighbor, true, OnEnd)); } float failsafeTime = Time.realtimeSinceStartup + maxLoadWaitTime; while ((loading.Count > 0) && (Time.realtimeSinceStartup < failsafeTime)) { yield return(null); } TryToExecuteParameter(sceneName, SceneData.Detail_Parameter.full_load); if (LoadNeighbor) { Debug.Log("LoadNeighbor"); StartCoroutine(LoadNeighbors(currentScene, localref[currentScene].SceneData)); } failsafeTime = Time.realtimeSinceStartup + maxLoadWaitTime; while ((loading.Count > 0) && (Time.realtimeSinceStartup < failsafeTime)) { yield return(null); } LocalToEnemyManager.OnLoadScene(sceneName); yield return(null); }
public static LocalToEnemyManager instance; private void Awake() => instance = this;
public void OnEnterToThisScene() { NewSceneStreamer.instance.LoadScene(SceneData.name, false, true); LocalToEnemyManager.ResetScenes(SceneData.scenes_to_reset); }