void Start() { if (instance) { Destroy(gameObject); } else { instance = this; DontDestroyOnLoad(gameObject); } }
void OnApplicationQuit() { instance = null; }