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