123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051 |
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- using UnityEngine;
- namespace GFGGame
- {
- public class ErrorCodeController
- {
- public static bool Handler(int errorCode)
- {
- if (errorCode == ET.ErrorCode.ERR_Success)
- {
- return false;
- }
- else if (errorCode == ET.ErrorCode.ERR_NetWorkError)
- {
- Alert.Show("连接服务器失败:\n请检查网络和服务器状态")
- .SetRightButton(true, "知道啦", (object data) =>
- {
- Application.Quit();
- });
- }
- else if (errorCode == ET.ErrorCode.ERR_ClientVersionError)
- {
- Alert.Show("版本已更新,请联系研发获取最新版本")
- .SetLeftButton(true, "知道了", (data) => {
- Application.Quit();
- });
- }
- else if (errorCode == ET.ErrorCode.ERR_AntiAddiction)
- {
- string promptStr = "您属于未成年人,已被纳入防沉迷系统。每日22时至次日8时,本游戏将无法为未成年人用户提供游戏服务。";
- Alert.Show(promptStr)
- .SetRightButton(true, "知道啦", (object data) =>
- {
- });
- }
- else
- {
- PromptController.Instance.ShowFloatTextPrompt("errorCode " + errorCode.ToString());
- ET.Log.Error("errorCode" + errorCode.ToString());
- return true;
- }
- return false;
- }
- }
- }
|