void Awake() { DontDestroyOnLoad(this.gameObject); if (mInstance == null) { mInstance = this; mInstance.handler = new NetHandler(ServerAdress, GetComponent<NetDispatcher>()); } }
void OnDestroy() { if (handler != null) { handler.Stop(); } if (mInstance != null) { mInstance = null; } }