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