// Sets up singleton instance. Will remain if one does not already exist in scene protected override void Init() { if(instance == null) { // DontDestroyOnLoad(this); instance = this; } else if(instance != this) { Destroy(gameObject); } }
protected override void Init() { if(_instance == null) { DontDestroyOnLoad(this.gameObject); _instance = this; } else if(_instance != this) { Debug.Log("Too many save managers"); Destroy(this.gameObject); } }