void Awake() { if (GenericNetworkManager.instance == null) { GenericNetworkManager.instance = this; } else { if (GenericNetworkManager.instance != this) { Destroy(GenericNetworkManager.instance.gameObject); GenericNetworkManager.instance = this; } } DontDestroyOnLoad(this.gameObject); }
private void Awake() { if (Instance == null) { Instance = this; } else { if (Instance != this) { Destroy(Instance.gameObject); Instance = this; } } DontDestroyOnLoad(gameObject); }