| | |
| | | |
| | | vPackList = AnalysisPackQueueAndDistribute(guid, vPackList); |
| | | |
| | | #if UNITY_EDITOR |
| | | if (Launch.Instance.isOpenSkillLogFile) |
| | | { |
| | | string packDetail = "处理前 : " + originPack + "\n"; |
| | | packDetail += "AnalysisPackQueueAndDistribute 处理后的包列表:\n"; |
| | | packDetail += PrintPackListDetail(vPackList, 0, guid); |
| | | |
| | | // 分段打印,避免消息被截断 |
| | | int chunkSize = 15000; // Unity日志单条消息最大长度约16000字符 |
| | | if (packDetail.Length > chunkSize) |
| | | { |
| | | int totalChunks = (packDetail.Length + chunkSize - 1) / chunkSize; |
| | | for (int i = 0; i < totalChunks; i++) |
| | | { |
| | | int startIndex = i * chunkSize; |
| | | int length = Mathf.Min(chunkSize, packDetail.Length - startIndex); |
| | | string chunk = packDetail.Substring(startIndex, length); |
| | | Debug.LogError($"[Part {i + 1}/{totalChunks}]\n{chunk}"); |
| | | } |
| | | } |
| | | else |
| | | { |
| | | Debug.LogError(packDetail); |
| | | } |
| | | |
| | | // 或者写入文件 |
| | | string filePath = Application.dataPath + "/../BattleReport/PackageAnalysis_" + DateTime.Now.ToString("yyyyMMdd_HHmmss") + ".txt"; |
| | | System.IO.Directory.CreateDirectory(System.IO.Path.GetDirectoryName(filePath)); |
| | | System.IO.File.WriteAllText(filePath, packDetail); |
| | | Debug.LogError("包分析结果已保存到: " + filePath); |
| | | } |
| | | #endif |
| | | |
| | | #region Start Print Pack List Detail |
| | | if (Launch.Instance.isOpenSkillLogFile) |