Пример #1
0
 public void OnDestroy()
 {
     if (_instance == this)
     {
         _instance = null;
     }
 }
Пример #2
0
 public void Awake()
 {
     if (_instance != null)
     {
         Destroy(this);
         return;
     }
     _instance = this;
 }