using UnityEngine; namespace GFGGame { public class ErrorCodeController { //返回结果为true时,表示可以在错误提示后继续处理后续逻辑 public static bool Handler(int errorCode) { switch (errorCode) { case ET.ErrorCode.ERR_NetWorkError: { AlertSystem.Show("网络异常,也有可能是服务器异常,请稍后再试!") .SetRightButton(true, "好的", (object data) => { GameController.QuitToLoginView(false); }); } break; case ET.ErrorCode.ERR_ClientVersionError: { AlertSystem.Show("客户端版本错误,请联系研发获取最新版本!") .SetLeftButton(true, "知道了", (data) => { Application.Quit(); }); } break; case ET.ErrorCode.Err_LoginCountFull: { AlertSystem.Show("游戏已爆满,请稍后再试!") .SetLeftButton(true, "好的", (data) => { }); } break; case ET.ErrorCode.Err_ServerMaintain: { AlertSystem.Show("服务器维护中,请稍后再试!") .SetLeftButton(true, "好的", (data) => { }); } break; case ET.ErrorCode.ERR_AntiAddiction: { AntiAddictionController.ShowAntiAddictionAlert(); return false; } default: if (ErrorCodeCfgArray.Instance.GetCfg(errorCode) != null) { PromptController.Instance.ShowFloatTextPrompt(ErrorCodeCfgArray.Instance.GetCfg(errorCode).tips); ET.Log.Debug("errorCode" + errorCode.ToString()); } else { PromptController.Instance.ShowFloatTextPrompt("errorCode " + errorCode.ToString()); ET.Log.Error("errorCode" + errorCode.ToString()); } return true; } return false; } } }