public void OnDisable() { if (instance == this) { instance = null; } }
public void Awake() { DontDestroyOnLoad(gameObject); if (instance) { Destroy(instance.gameObject); } instance = this; }