public void Init() { #region 在项目中创建Debug保存文件 _hasInit = true; //Debug 文件根目录 string binRootPath = DebugRootPath.Instance.GetBinFileRootPath(); if (!Directory.Exists(binRootPath)) { Directory.CreateDirectory(binRootPath); } //Debug Log文件根目录 string logPath = DebugRootPath.Instance.GetLogFolderPath(); if (!Directory.Exists(logPath)) { Directory.CreateDirectory(logPath); } //Debug Log文件 _outPutPath = DebugRootPath.Instance.GetCurLogFilePath(); if (Directory.Exists(DebugRootPath.Instance.GetBinFileRootPath())) { if (File.Exists(_outPutPath)) { File.Delete(_outPutPath); } } else { Directory.CreateDirectory(DebugRootPath.Instance.GetBinFileRootPath()); } //保存Debug至文件 MyDebug.Init(_outPutPath); #endregion }