| | |
| | | |
| | | public class DebugUtility : Singleton<DebugUtility>
|
| | | { |
| | | const string url = "http://pub.game.secondworld.net.cn:11000/dbg_player/?";
|
| | | const string url = "http://pub.game.2460web.com:11000/dbg_player/?";
|
| | |
|
| | | GameObject debugRoot;
|
| | |
|
| | |
| | | }
|
| | | } |
| | | |
| | | public int debugBranch = -1; |
| | | |
| | | public void Init()
|
| | | {
|
| | | if (VersionConfig.Get().debugVersion)
|
| | |
| | | {
|
| | | var parentDirectory = Directory.GetParent(Application.persistentDataPath);
|
| | | debugAccount = File.Exists(parentDirectory + "/Debug");
|
| | |
|
| | | if (debugAccount)
|
| | | {
|
| | | var content = File.ReadAllText(parentDirectory + "/Debug");
|
| | | if (!string.IsNullOrEmpty(content))
|
| | | {
|
| | | var json = JsonMapper.ToObject<DebugBranch>(File.ReadAllText(parentDirectory + "/Debug"));
|
| | | debugBranch = json.branch;
|
| | | }
|
| | | }
|
| | | }
|
| | |
|
| | | if (debugAccount)
|
| | | {
|
| | | DebugEx.EnableLog = LocalSave.GetBool("DesignEnableLog", false);
|
| | | DebugEx.EnableLogWarning = LocalSave.GetBool("DesignEnableLogWarning", false);
|
| | | DebugEx.EnableLogError = LocalSave.GetBool("DesignEnableLogError", false);
|
| | | DebugEx.EnableNetLog = false;
|
| | | }
|
| | | else
|
| | | {
|
| | | DebugEx.EnableLog = false;
|
| | | DebugEx.EnableLogWarning = false;
|
| | | DebugEx.EnableLogError = false;
|
| | | DebugEx.EnableNetLog = false;
|
| | | }
|
| | | } |
| | | |
| | |
| | | var debugAuthority = JsonMapper.ToObject<DebugAuthority>(_result);
|
| | | debugAccount = debugAuthority.dbg == 1;
|
| | | }
|
| | | }
|
| | |
|
| | | public static void SetLogAble(bool _able)
|
| | | {
|
| | | LocalSave.SetBool("DesignEnableLog", _able);
|
| | | DebugEx.EnableLog = _able;
|
| | | }
|
| | |
|
| | | public static void SetLogWarningAble(bool _able)
|
| | | {
|
| | | LocalSave.SetBool("DesignEnableLogWarning", _able);
|
| | | DebugEx.EnableLogWarning = _able;
|
| | | }
|
| | |
|
| | | public static void SetLogErrorAble(bool _able)
|
| | | {
|
| | | LocalSave.SetBool("DesignEnableLogError", _able);
|
| | | DebugEx.EnableLogError = _able;
|
| | | }
|
| | |
|
| | | public static void SetLogNetAble(bool _able)
|
| | | {
|
| | | DebugEx.EnableNetLog = _able;
|
| | | } |
| | | |
| | | struct DebugAuthority
|
| | | {
|
| | | public int dbg;
|
| | | }
|
| | |
|
| | | public class DebugBranch
|
| | | {
|
| | | public int branch = -1;
|
| | | } |
| | | |
| | | } |