using Protobuf; using UnityEngine; namespace KTGMGemClient { public class CommonDebugHelper { public static void Debug(object str) { if (GameConfig.OpenDebug) { UnityEngine.Debug.Log(str); } } public static void DebugLong(string str) { if (GameConfig.OpenDebug) { UnityEngine.Debug.Log("************** " + str + " **************"); } } public static void DebugError(string str) { if (GameConfig.OpenDebug) { UnityEngine.Debug.LogError(str); } } public static void DebugSocket(int Errorcode) { ErrorCode code = (ErrorCode)Errorcode; if (GameConfig.OpenDebug) { switch (code) { case ErrorCode.Success: UnityEngine.Debug.Log("成功"); break; case ErrorCode.ChannelIdNoExist: UnityEngine.Debug.LogWarning("************** 渠道ID不存在 **************"); break; case ErrorCode.UserNameInvalid: UnityEngine.Debug.LogWarning("************** 账号名太短 **************"); break; case ErrorCode.UserPassWordInvalid: UnityEngine.Debug.LogWarning("************** 账号密码不正确 **************"); break; case ErrorCode.UnknowError: UnityEngine.Debug.LogWarning("************** 内部错误 **************"); break; case ErrorCode.InputInvalid: UnityEngine.Debug.LogWarning("************** 参数错误 **************"); break; case ErrorCode.Timeout: UnityEngine.Debug.LogWarning("************** 超时 **************"); break; case ErrorCode.SessionKeyInvalid: UnityEngine.Debug.LogWarning("************** 登陆失败,SessionKey错误 **************"); break; case ErrorCode.LoginNoUser: UnityEngine.Debug.LogWarning("************** 没有角色,请创建 **************"); break; case ErrorCode.NotEnoughMoney: UnityEngine.Debug.LogWarning("************** 金币不足 **************"); break; case ErrorCode.NotEnoughGold: UnityEngine.Debug.LogWarning("************** 钻石不足 **************"); break; case ErrorCode.NotEnoughGem: UnityEngine.Debug.LogWarning("************** 宝石不足 **************"); break; case ErrorCode.NotFoundFriend: UnityEngine.Debug.LogWarning("************** 好友没有找到 **************"); break; case ErrorCode.AlreadyFriend: UnityEngine.Debug.LogWarning("************** 已经是好友了 **************"); break; case ErrorCode.InBlockFriend: UnityEngine.Debug.LogWarning("************** 黑名单不能添加好友 **************"); break; case ErrorCode.MaxFriend: UnityEngine.Debug.LogWarning("************** 好友已经达到上限 **************"); break; case ErrorCode.MaxNickName: UnityEngine.Debug.LogWarning("************** 昵称大于最大长度 **************"); break; case ErrorCode.InvalidNickName: UnityEngine.Debug.LogWarning("************** 昵称有非法字符 **************"); break; case ErrorCode.MaxStoreLimit: UnityEngine.Debug.LogWarning("************** !购买失败,超过最大限制 **************"); break; case ErrorCode.NotEnoughStoreBuy: UnityEngine.Debug.LogWarning("************** !购买失败,货币不足 **************"); break; case ErrorCode.NotOpenPassPort: UnityEngine.Debug.LogWarning("************** !高级通行证购买失败,活动未开启 **************"); break; case ErrorCode.AlreadyPassPort: UnityEngine.Debug.LogWarning("************** !高级通行证购买失败,已经购买了 **************"); break; case ErrorCode.NeedVipPassPortTakeItem: UnityEngine.Debug.LogWarning("************** !领取通行证奖励失败,不是高级通行证 **************"); break; case ErrorCode.NeedLevelPassPortTakeItem: UnityEngine.Debug.LogWarning("************** !领取通行证奖励失败,等级不足 **************"); break; case ErrorCode.AlreadyPassPortTakeItem: UnityEngine.Debug.LogWarning("************** !领取通行证奖励失败,已经领取了 **************"); break; case ErrorCode.InvalidPassPortBuyLevel: UnityEngine.Debug.LogWarning("************** !购买通行证等级失败,购买等级小于当前等级 **************"); break; case ErrorCode.HasUnlockArenaBox: UnityEngine.Debug.LogWarning("************** ! 解锁失败,已经解锁了 **************"); break; case ErrorCode.OtherUnlockingArenaBox: UnityEngine.Debug.LogWarning("************** ! 解锁失败,另一个在解锁中 **************"); break; case ErrorCode.NotTimeTakeArenaBox: UnityEngine.Debug.LogWarning("************** ! 开宝箱失败,时间没到 **************"); break; } //UIManager.Instance.ShowWarningWind(log); } } } }