Example #1
0
    public void homeClick(GameObject button)
    {
        UILabel label = GameObject.Find("log").GetComponent <UIInput>().label;

        label.text += "\r\nhomeClick";
        MGNetWorking.disconnect();
        label.text += "\r\ndisconnect";
        Application.LoadLevel("startGameScene");
        label.text    += "\r\nApplication.LoadLevel(\"startGameScene\")";
        Time.timeScale = 1;
        this.GetComponent <MGInitGameData>().destroyGameData();
    }
Example #2
0
 public void destroyGameData()
 {
     Debug.Log("destroyGameDate");
     MGNotificationCenter.defaultCenter().removeAllObserver();
     if (syncSock != null)
     {
         syncSock.Close();
     }
     if (syncSockTCP != null)
     {
         syncSockTCP.Close();
     }
     if (clientSockTCP != null)
     {
         clientSockTCP.Close();
     }
     if (syncThread != null)
     {
         syncThread.Abort();
     }
     CancelInvoke("syncNetwork");
     MGNetWorking.disconnect();
     MGGlobalDataCenter.defaultCenter().backToDefaultValues();
 }