Esempio n. 1
0
 private void OnDestroy()
 {
     if (current == this)
     {
         current = null;
     }
 }
Esempio n. 2
0
 private void Awake()
 {
     if (current && current != this)
     {
         Debug.LogError("PCG Main have to be singleton!");
         DestroyImmediate(gameObject);
     }
     current = this;
 }