Ejemplo n.º 1
0
 private void OnDestroy()
 {
     if (main == this)
     {
         main = null;
     }
 }
Ejemplo n.º 2
0
 private void Awake()
 {
     if (main != null)
     {
         Debug.LogWarning("MainInstance main was not cleaned up, manually cleaning up instance");
         main.Clean();
     }
     main = this;
 }