/// <summary> /// Awake is called when the script instance is being loaded. /// </summary> void Awake() { if (instance == null) { instance = this; DontDestroyOnLoad(gameObject); } else { Destroy(gameObject); } }
public override void Awake() { SharedInstance = this; base.Awake(); }