Esempio n. 1
0
 private void OnDestroy()
 {
     if (instance == this)
     {
         instance = null;
     }
 }
Esempio n. 2
0
 void Start()
 {
     if (instance == null)
     {
         DontDestroyOnLoad(this);
         instance = this;
     }
     else
     {
         Destroy(gameObject);
     }
 }