예제 #1
0
    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);
    }
예제 #2
0
 public static LocalToEnemyManager instance; private void Awake() => instance = this;
예제 #3
0
 public void OnEnterToThisScene()
 {
     NewSceneStreamer.instance.LoadScene(SceneData.name, false, true);
     LocalToEnemyManager.ResetScenes(SceneData.scenes_to_reset);
 }