void Awake() { if(instance!=null){ DestroyImmediate(gameObject); }else{ instance = this; DontDestroyOnLoad(gameObject); } }
void Awake() { if (instance != null) { DestroyImmediate(gameObject); } else { instance = this; DontDestroyOnLoad(gameObject); } }