更新 Editor/Build/BuildCLI/AppBuildHelper.cs

This commit is contained in:
yuliuren 2025-07-31 21:48:09 +08:00
parent 2914534c66
commit da3e29a712

View File

@ -54,7 +54,22 @@ public static class AppBuildHelper
}
else
{
Debug.Log($"错误信息: {report.SummarizeErrors()}");
#if UNITY_2023_1_OR_NEWER
Debug.LogError(report.SummarizeErrors());
#else
var errors = new List<string>();
foreach (var step in report.steps)
{
foreach (var msg in step.messages)
{
if (msg.type == LogType.Error || msg.type == LogType.Exception)
{
errors.Add($"[Step: {step.name}] {msg.content}");
}
}
}
Debug.LogError($"构建失败,错误信息:\n{string.Join("\n", errors)}");
#endif
}
}
}