Exemplo n.º 1
0
 private void OnDestroy()
 {
     if (this == _instance)
     {
         _instance = null;
     }
 }
Exemplo n.º 2
0
 private void Awake()
 {
     if (_instance != null && _instance != this)
     {
         Destroy(gameObject);
     }
     else
     {
         _instance = this;
     }
 }