private void Awake()
 {
     if (SpinFree.instance == null)
     {
         SpinFree.instance = this;
     }
     else if (SpinFree.instance != this)
     {
         Destroy(gameObject);
     }
 }
Beispiel #2
0
 void Awake()
 {
     if (instance != null)
     {
         Destroy(gameObject);
     }
     else
     {
         instance = this;
         GameObject.DontDestroyOnLoad(gameObject);
     }
 }
 private void OnDestroy()
 {
     SpinFree.instance = null;
 }