using System; using System.Collections.Generic; using System.Linq; using System.Text; using GFGGame; using UnityEngine; namespace ET { public class DisConnectedCompnentDestroy : DestroySystem { public override void Destroy(DisConnectedCompnent self) { if (self.ToReconnect) { if(GameGlobal.zoneScene.GetComponent().SessionState == SessionState.Gate) { if (!Application.isFocused) { AlertSystem.Show("与服务器连接已断开。") .SetRightButton(true, "重新连接", (object data) => { LoginController.ReqReConnectGate().Coroutine(); }); return; } else if(self.SessionState == SessionState.Gate) { LoginController.ReqReConnectGate().Coroutine(); } else { LogUtil.LogDev("DisConnectedCompnentDestroy"); } } else { GameController.QuitToLoginView(false); } } //重置状态 self.ToReconnect = true; } } public static class DisConnectedCompnentSystem { public static void CancelAlert(this DisConnectedCompnent self) { self.ToReconnect = false; } } }