static void ShowLog() { scrollPos = GUILayout.BeginScrollView(scrollPos); try { GUIUtil.SafeTextArea(showContent); } catch (Exception e) { GUILayout.TextArea(e.ToString()); } GUILayout.EndScrollView(); if (URLManager.GetURL("LogUpLoadURL") != null) { if (GUILayout.Button("上传日志")) { HTTPTool.Upload_Request_Thread(URLManager.GetURL("LogUpLoadURL"), LogPath, UploadCallBack); } } else { GUILayout.Label("上传日志需要在 URLConfig -> LogUpLoadURL 配置上传目录"); } #if UNITY_ANDROID if (GUILayout.Button("导出到设备")) { try { string path = phonePath + LogName + ".txt"; FileTool.CreatFilePath(path); File.Copy(LogPath, path, true); GUIUtil.ShowTips("复制成功"); } catch (Exception e) { GUIUtil.ShowTips(e.ToString()); } } #endif if (GUILayout.Button("复制到剪贴板")) { TextEditor tx = new TextEditor(); tx.text = showContent; tx.OnFocus(); tx.Copy(); } if (GUILayout.Button("返回上层")) { isShowLog = false; } }
static void ReplayListGUI() { scrollPos = GUILayout.BeginScrollView(scrollPos); for (int i = 0; i < FileNameList.Length; i++) { if (!isUploadReplay) { if (GUILayout.Button(FileNameList[i])) { ChoseReplayMode(true, FileNameList[i]); } } else { if (GUILayout.Button("上传 " + FileNameList[i])) { string replayPath = GetReplayEventFilePath(FileNameList[i]); string randomPath = GetReplayRandomFilePath(FileNameList[i]); HTTPTool.Upload_Request_Thread(URLManager.GetURL("ReplayFileUpLoadURL"), replayPath, UploadCallBack); HTTPTool.Upload_Request_Thread(URLManager.GetURL("ReplayFileUpLoadURL"), randomPath, UploadCallBack); } } } GUILayout.EndScrollView(); if (GUILayout.Button("清除记录")) { OpenWarnWindow("确定要删除所有记录吗?", () => { Debug.Log("已删除所有记录"); FileTool.SafeDeleteDirectory(PathTool.GetAbsolutePath(ResLoadLocation.Persistent, c_directoryName)); FileNameList = new string[0]; }); } if (URLManager.GetURL("ReplayFileUpLoadURL") != null) { if (GUILayout.Button("上传模式 : " + isUploadReplay)) { isUploadReplay = !isUploadReplay; } } else { GUILayout.Label("上传持久数据需要在 URLConfig -> ReplayFileUpLoadURL 配置上传目录"); } if (GUILayout.Button("返回上层")) { MenuStatus = DevMenuEnum.MainMenu; } }
static void ShowPersistentFileList() { scrollPos = GUILayout.BeginScrollView(scrollPos); for (int i = 0; i < FileNameList.Length; i++) { if (GUILayout.Button(FileNameList[i])) { //isShowPersistentFile = true; //scrollPos = Vector2.zero; //showContent = PersistentFileManager.GetData(FileNameList[i]); //LogPath = PersistentFileManager.GetPath(FileNameList[i]); string path = PersistentFileManager.GetPath(FileNameList[i]); HTTPTool.Upload_Request_Thread(URLManager.GetURL("PersistentFileUpLoadURL"), path, UploadCallBack); } } GUILayout.EndScrollView(); if (URLManager.GetURL("PersistentFileUpLoadURL") != null) { if (GUILayout.Button("上传所有持久数据文件")) { for (int i = 0; i < FileNameList.Length; i++) { string path = PersistentFileManager.GetPath(FileNameList[i]); HTTPTool.Upload_Request_Thread(URLManager.GetURL("PersistentFileUpLoadURL"), path, UploadCallBack); } } } else { GUILayout.Label("上传持久数据文件需要在 URLConfig -> PersistentFileUpLoadURL 配置上传目录"); } if (GUILayout.Button("清除持久数据文件")) { OpenWarnWindow("确定要删除所有持久数据文件吗?", () => { Debug.Log("已删除所有持久数据文件"); FileTool.SafeDeleteDirectory(PathTool.GetAbsolutePath(ResLoadLocation.Persistent, PersistentFileManager.c_directoryName)); FileNameList = new string[0]; }); } if (GUILayout.Button("返回上层")) { MenuStatus = DevMenuEnum.MainMenu; } }
static void ShowPersistentFile() { scrollPos = GUILayout.BeginScrollView(scrollPos); try { GUIUtil.SafeTextArea(showContent); } catch (Exception e) { GUILayout.TextArea(e.ToString()); } GUILayout.EndScrollView(); if (URLManager.GetURL("PersistentFileUpLoadURL") != null) { if (GUILayout.Button("上传持久数据")) { HTTPTool.Upload_Request_Thread(URLManager.GetURL("PersistentFileUpLoadURL"), LogPath, UploadCallBack); } } else { GUILayout.Label("上传持久数据需要在 URLConfig -> PersistentFileUpLoadURL 配置上传目录"); } if (GUILayout.Button("复制到剪贴板")) { TextEditor tx = new TextEditor(); tx.text = showContent; tx.OnFocus(); tx.Copy(); } if (GUILayout.Button("返回上层")) { isShowPersistentFile = false; } }