Esempio n. 1
0
 void OnSceneLoadCompleted(AsyncOperation op)
 {
     UIManager.instance.toggleHUD(LoadHUD);
     UIManager.instance.toggleHUDStateLock(LockHUD);
     startupEvents?.Invoke();
     OnSceneLoad?.Invoke();
 }
Esempio n. 2
0
        public static void SceneLoad()
        {
            Scene scene = SceneManager.GetActiveScene();

            //DebugManager.LogToFile("[OnSceneLoad] " + scene.name + " has loaded");
            OnSceneLoad?.Invoke(scene);
        }
Esempio n. 3
0
 public void Load()
 {
     OnSceneLoad?.Invoke(this);
     _Objects.ForEach(
         s =>
     {
         s.Draw();
     });
 }
Esempio n. 4
0
            internal static IEnumerator Studio_ImportScene_Postfix_Coroutine(string _path, SceneLoadMode _mode)
            {
                yield return(Toolbox.WaitForEndOfFrame);

                yield return(Toolbox.WaitForEndOfFrame);

                Core.DebugLog($"Studio_ImportScene_Postfix_Coroutine [mode: {_mode}]");
                OnSceneLoad?.Invoke(null, new SceneLoadEventArgs(_path, SceneLoadMode.Import, SceneLoadState.Coroutine));
            }
Esempio n. 5
0
        /// <summary>
        /// Sets the currently active scene to the provided scene.
        /// </summary>
        /// <param name="scene">Scene which to set as active.</param>
        internal static void SetActive(Prefab scene)
        {
            activateOnLoadScene = null;

            if (scene != null)
            {
                activeSceneUUID = scene.UUID;
                activeSceneName = scene.Name;
                isGenericPrefab = !scene.IsScene;

                Internal_SetActiveScene(scene.GetCachedPtr());

                OnSceneLoad?.Invoke(activeSceneUUID);
            }
        }
Esempio n. 6
0
    public static event System.Action <int> OnSceneLoad; // Gotta send an int over due to GetSceneIndex returning the old index

    public void LoadNextScene()
    {
        int currentSceneIndex = SceneManager.GetActiveScene().buildIndex;

        if (currentSceneIndex + 1 >= SceneManager.sceneCountInBuildSettings)
        {
            Debug.LogWarning("Game Scene Manager attempted to load a scene index greater than the ones avaliable. Reloading first scene...");
            SceneManager.LoadScene(0);
        }
        else
        {
            currentSceneIndex++;
            SceneManager.LoadScene(currentSceneIndex);
            OnSceneLoad?.Invoke(currentSceneIndex);
        }
    }
Esempio n. 7
0
    public void LoadPreviousScene()
    {
        int currentSceneIndex = SceneManager.GetActiveScene().buildIndex;

        if (currentSceneIndex - 1 < 0)
        {
            Debug.LogWarning("Game Scene Manager attempted to load a scene index greater than the ones avaliable. Reloading first scene...");
            SceneManager.LoadScene(0);
        }
        else
        {
            currentSceneIndex--;
            SceneManager.LoadScene(currentSceneIndex);
            OnSceneLoad?.Invoke(currentSceneIndex);
        }
    }
    public void UpdateScene(State state)
    {
        foreach (StateInfo sI in StateInfoList)
        {
            if (sI.State == state)
            {
                Debug.Log("Whaddup");

                CurrentStateInfo            = sI;
                loadingOperation            = SceneManager.LoadSceneAsync("TestScene");
                loadingOperation.completed += LoadingComplete;
                OnSceneLoad?.Invoke(loadingOperation);
                break;
            }
        }
    }
Esempio n. 9
0
 private static void Studio_ImportScene_Prefix(string _path)
 {
     Core.DebugLog($"Studio_ImportScene_Prefix");
     OnSceneLoad?.Invoke(null, new SceneLoadEventArgs(_path, SceneLoadMode.Import, SceneLoadState.Pre));
 }
 void SceneLoaded(Scene scene, LoadSceneMode loadSceneMode)
 {
     OnSceneLoad?.Invoke();
 }
Esempio n. 11
0
 // Called Second
 void OnSceneLoaded(Scene scene, LoadSceneMode mode)
 {
     Debug.Log($"OnSceneLoaded called: {scene}");
     OnSceneLoad?.Invoke(scene);
 }
Esempio n. 12
0
 public static void LoadPreparedScene(SceneAsync scene)
 {
     OnSceneLoad?.Invoke(scene.name);
     scene.ao.allowSceneActivation = true;
 }
Esempio n. 13
0
 public static void LoadScene(string sceneName)
 {
     OnSceneLoad?.Invoke(sceneName);
     SceneManager.LoadScene(sceneName);
 }
Esempio n. 14
0
 private static void Studio_ImportScene_Postfix(string _path)
 {
     Core.DebugLog($"Studio_ImportScene_Postfix");
     OnSceneLoad?.Invoke(null, new SceneLoadEventArgs(_path, SceneLoadMode.Import, SceneLoadState.Post));
     Instance.StartCoroutine(Studio_ImportScene_Postfix_Coroutine(_path, SceneLoadMode.Import));
 }
Esempio n. 15
0
 private static void Studio_SaveScene_Postfix()
 {
     Core.DebugLog($"Studio_SaveScene_Postfix");
     OnSceneLoad?.Invoke(null, new SceneLoadEventArgs(null, SceneLoadMode.Save, SceneLoadState.Post));
     Instance.StartCoroutine(Studio_SaveScene_Postfix_Coroutine(null, SceneLoadMode.Save));
 }
Esempio n. 16
0
 private static void Studio_SaveScene_Prefix()
 {
     Core.DebugLog($"Studio_SaveScene_Prefix");
     OnSceneLoad?.Invoke(null, new SceneLoadEventArgs(null, SceneLoadMode.Save, SceneLoadState.Pre));
 }
Esempio n. 17
0
 private static IEnumerator Studio_LoadSceneCoroutine_Postfix_Coroutine(string _path)
 {
     Core.DebugLog($"Studio_LoadSceneCoroutine_Postfix_Coroutine");
     OnSceneLoad?.Invoke(null, new SceneLoadEventArgs(_path, SceneLoadMode.Load, SceneLoadState.Post));
     yield break;
 }