private void Awake() { if (instance != null && instance != this) { Destroy(this.gameObject); } instance = this; DontDestroyOnLoad(this.gameObject); }
private void OnEnable() { if (PlayfabController.PFC == null) { PlayfabController.PFC = this; } else { if (PlayfabController.PFC != this) { Destroy(this.gameObject); } } DontDestroyOnLoad(this.gameObject); }
private void Awake() { instance = this; }