Пример #1
0
 protected virtual void OnDestroy()
 {
     if (mInstance == this)
     {
         Exists    = false;
         mInstance = null;
     }
 }
Пример #2
0
 protected virtual void Awake()
 {
     if (mInstance != null)
     {
         Destroy(this.gameObject);
         return;
     }
     else
     {
         Exists = false;
     }
     mInstance = this;
     Exists    = true;
     DontDestroyOnLoad(this);
     mIsInit = true;
 }