public static GlobalSceneManager GetInstance() { if (instance == null) { instance = new GlobalSceneManager(); } return(instance); }
private void Awake() { if (GlobalSceneManager.current != null) { Destroy(this.gameObject); } else { GlobalSceneManager.current = this; } currentscene = Array.IndexOf(scenelist, SceneManager.GetActiveScene().name); }
public virtual void Awake() { if (mInstance == null) { mInstance = this as GlobalSceneManager; DontDestroyOnLoad(gameObject); } else { Destroy(gameObject); } }