Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- namespace GameCore
- {
- using UnityEngine.SceneManagement;
- public class LoadingManager : SingletonData<LoadingManager>
- {
- #if UNITY_EDITOR
- [UnityEditor.MenuItem ("Game/Data/LoadingManager")] public static void Select () { UnityEditor.Selection.activeObject = instance; }
- public override void ResetDefault () { nextScene = "Menu"; }
- public override void InitOnCreate () { }
- #else
- public override void ResetDefault () { }
- #endif
- public string nextScene = "Menu";
- Scene activeScene => SceneManager.GetActiveScene ();
- public void ReloadScene ()
- {
- SceneManager.LoadScene (activeScene.buildIndex);
- }
- public void LoadScene (string SceneName)
- {
- SceneManager.LoadScene (SceneName);
- }
- }
- }
Add Comment
Please, Sign In to add comment