浏览代码

断线重连后台运行是不触发

guodong 2 年之前
父节点
当前提交
2a2be578f8
共有 1 个文件被更改,包括 4 次插入3 次删除
  1. 4 3
      GameClient/Assets/Game/HotUpdate/Controller/LoginController.cs

+ 4 - 3
GameClient/Assets/Game/HotUpdate/Controller/LoginController.cs

@@ -257,9 +257,10 @@ namespace GFGGame
 
         public static async ETTask ReqReConnectGate()
         {
-#if UNITY_EDITOR
-            return;
-#endif
+            if(!Application.isFocused)
+            {
+                return;
+            }
             ViewManager.Show<ModalStatusView>("重新连接中...");
             int errorCode = await LoginHelper.EnterGame(GameGlobal.zoneScene);
             if (errorCode != ErrorCode.ERR_Success)