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