private void MakeInstance()
 {
     if (_instance == null)
     {
         _instance = this;
     }
     else if (_instance != null && _instance != this)
     {
         Destroy(gameObject);
     }
 }
Exemple #2
0
 void MakeSingleton()
 {
     if (instance != null)
     {
         Destroy(this);
     }
     else
     {
         instance = this;
         DontDestroyOnLoad(this);
     }
 }