Browse Source

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

guodong 2 years ago
parent
commit
2a2be578f8
1 changed files with 4 additions and 3 deletions
  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()
         public static async ETTask ReqReConnectGate()
         {
         {
-#if UNITY_EDITOR
-            return;
-#endif
+            if(!Application.isFocused)
+            {
+                return;
+            }
             ViewManager.Show<ModalStatusView>("重新连接中...");
             ViewManager.Show<ModalStatusView>("重新连接中...");
             int errorCode = await LoginHelper.EnterGame(GameGlobal.zoneScene);
             int errorCode = await LoginHelper.EnterGame(GameGlobal.zoneScene);
             if (errorCode != ErrorCode.ERR_Success)
             if (errorCode != ErrorCode.ERR_Success)