Ejemplo n.º 1
0
 private void OnDestroy()
 {
     if (_Instance == this)
     {
         _Instance = null;
     }
 }
Ejemplo n.º 2
0
 private void Awake()
 {
     if (_Instance)
     {
         Destroy(gameObject);
     }
     else
     {
         _Instance = this;
         DontDestroyOnLoad(gameObject);
     }
 }