using UnityEngine; namespace GFGGame { public class ErrorCodeController { public static bool Handler(int errorCode) { switch(errorCode) { case ET.ErrorCode.ERR_Success: { return false; } case ET.ErrorCode.ERR_NetWorkError: { Alert.Show("网络异常") .SetRightButton(true, "知道了", (object data) => { Application.Quit(); }); } break; case ET.ErrorCode.ERR_ClientVersionError: { Alert.Show("客户端版本错误,请联系研发获取最新版本!") .SetLeftButton(true, "知道了", (data) => { Application.Quit(); }); } break; case ET.ErrorCode.Err_LoginCountFull: { Alert.Show("游戏已爆满,请稍后再试!") .SetLeftButton(true, "知道了"); } break; case ET.ErrorCode.Err_ServerMaintain: { Alert.Show("服务器维护中,请稍后再试!") .SetLeftButton(true, "知道了", (data) => { Application.Quit(); }); } break; case ET.ErrorCode.ERR_AntiAddiction: { string promptStr = "您属于未成年人,已被纳入防沉迷系统。每日22时至次日8时,本游戏将无法为未成年人用户提供游戏服务。"; Alert.Show(promptStr) .SetRightButton(true, "知道啦", (object data) => { }); } break; default: if (ErrorCodeCfgArray.Instance.GetCfg(errorCode) != null) { PromptController.Instance.ShowFloatTextPrompt(ErrorCodeCfgArray.Instance.GetCfg(errorCode).tips); ET.Log.Debug("errorCode" + errorCode.ToString()); return true; } else { PromptController.Instance.ShowFloatTextPrompt("errorCode " + errorCode.ToString()); ET.Log.Error("errorCode" + errorCode.ToString()); return true; } } return false; } } }