void OnSceneLoadCompleted(AsyncOperation op) { UIManager.instance.toggleHUD(LoadHUD); UIManager.instance.toggleHUDStateLock(LockHUD); startupEvents?.Invoke(); OnSceneLoad?.Invoke(); }
public static void SceneLoad() { Scene scene = SceneManager.GetActiveScene(); //DebugManager.LogToFile("[OnSceneLoad] " + scene.name + " has loaded"); OnSceneLoad?.Invoke(scene); }
public void Load() { OnSceneLoad?.Invoke(this); _Objects.ForEach( s => { s.Draw(); }); }
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)); }
/// <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); } }
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); } }
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; } } }
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(); }
// Called Second void OnSceneLoaded(Scene scene, LoadSceneMode mode) { Debug.Log($"OnSceneLoaded called: {scene}"); OnSceneLoad?.Invoke(scene); }
public static void LoadPreparedScene(SceneAsync scene) { OnSceneLoad?.Invoke(scene.name); scene.ao.allowSceneActivation = true; }
public static void LoadScene(string sceneName) { OnSceneLoad?.Invoke(sceneName); SceneManager.LoadScene(sceneName); }
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)); }
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)); }
private static void Studio_SaveScene_Prefix() { Core.DebugLog($"Studio_SaveScene_Prefix"); OnSceneLoad?.Invoke(null, new SceneLoadEventArgs(null, SceneLoadMode.Save, SceneLoadState.Pre)); }
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; }