private void OnGUI()
        {
            var setting = HookLuaSetup.setting;

            if (GUI.Button(new Rect(0, 0, 200, 100), "Connect"))
            {
                NetWorkClient.ConnectServer(setting.ip, setting.port);
            }

            setting.ip = GUI.TextField(new Rect(210, 20, 200, 60), setting.ip);

            if (GUI.Button(new Rect(0, 110, 200, 100), "Disconnect"))
            {
                NetWorkClient.Close();
            }
            if (setting.discardInvalid)
            {
                if (GUI.Button(new Rect(0, 220, 200, 100), "ShowAll"))
                {
                    setting.discardInvalid = false;
                }
            }
            else
            {
                if (GUI.Button(new Rect(0, 220, 200, 100), "HideUseless"))
                {
                    setting.discardInvalid = true;
                }
            }
        }
 private void WaitDestory()
 {
     desotryCount++;
     if (desotryCount > 10)
     {
         UnityEditor.EditorApplication.update -= WaitDestory;
         NetWorkClient.Close();
         desotryCount = 0;
     }
 }
        private void OnApplicationQuit()
        {
#if UNITY_EDITOR
            desotryCount = 0;
            Destroy(gameObject);
            UnityEditor.EditorApplication.update += WaitDestory;
#else
            NetWorkClient.Close();
#endif
        }
 private void WaitDestory()
 {
     desotryCount++;
     if (desotryCount > 10)
     {
         UnityEditor.EditorApplication.update -= WaitDestory;
         if (LuaProfiler.mainL != IntPtr.Zero)
         {
             LuaDLL.lua_close(LuaProfiler.mainL);
         }
         LuaProfiler.mainL = IntPtr.Zero;
         NetWorkClient.Close();
         desotryCount = 0;
     }
 }
Example #5
0
 private void OnApplicationQuit()
 {
     NetWorkClient.Close();
 }