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