private void Awake() { if (instance == null) { instance = this; //DontDestroyOnLoad(gameObject); } }
public void Awake() { if (instance == null) { instance = this; DontDestroyOnLoad(instance); instance.scenesNameStack = new Stack <string>(); instance.scenesNameStack.Push(SceneManager.GetActiveScene().name); StartCoroutine(FadeTo(fadeInAlpha, 0.3f)); } else { if (this != instance) { Destroy(gameObject); } } }