示例#1
0
        static bool Quit()
        {
            NetworkServer.Close();
#if UPR_LUA_PROFILER
            NetWorkClient.Close();
#endif
            return(true);
        }
示例#2
0
        private void OnApplicationQuit()
        {
#if UNITY_EDITOR
            desotryCount = 0;
            Destroy(gameObject);
            UnityEditor.EditorApplication.update += WaitDestory;
#else
            NetWorkClient.Close();
#endif
        }
示例#3
0
 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;
     }
 }
示例#4
0
    public static int Close(IntPtr l)
    {
        int result;

        try
        {
            NetWorkClient netWorkClient = (NetWorkClient)LuaObject.checkSelf(l);
            netWorkClient.Close();
            LuaObject.pushValue(l, true);
            result = 1;
        }
        catch (Exception e)
        {
            result = LuaObject.error(l, e);
        }
        return(result);
    }
 internal void Close()
 {
     _client?.Close();
     _client = null;
 }