private void MakeSingleton() { if (_instance == null) { _instance = this; DontDestroyOnLoad(gameObject); } else if (_instance != null && _instance != this) { Destroy(gameObject); } }
} //Awake void MakeSingleton() { if (instance != null) { Destroy(gameObject); } else { instance = this; DontDestroyOnLoad(gameObject); } }//MakeSingleton