void Awake() { if (instance != null) { Destroy(gameObject); throw new UnityException("double singleton"); } instance = this; DontDestroyOnLoad(gameObject); }
void Awake() { if(instance != null) { Destroy(gameObject); throw new UnityException("double singleton"); } instance = this; //DontDestroyOnLoad(gameObject); }