Esempio n. 1
0
 protected void OnDestroy()
 {
     if (singleton == this)
     {
         singleton = null;
     }
 }
Esempio n. 2
0
 protected void Awake()
 {
     if (singleton == null)
     {
         singleton = this;
         DontDestroyOnLoad(singleton);
         init();
     }
     else
     {
         Destroy(this);
     }
 }