Skip to content

Commit 16ac0f9

Browse files
author
涂政
committed
update
1 parent 0e4e3d9 commit 16ac0f9

File tree

2 files changed

+32
-16
lines changed

2 files changed

+32
-16
lines changed

Demo/Addressable/Assets/BuildReport/Scripts/Editor/ReportGeneration/BRT_ReportGenerator.cs

Lines changed: 30 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -3447,22 +3447,38 @@ public static void ShowBuildReport()
34473447

34483448
// has to be called in main thread
34493449
static void ShowBuildReportWithLastValues()
3450+
{
3451+
try
3452+
{
3453+
BRT_BuildReportWindow brtWindow = (BRT_BuildReportWindow)
3454+
EditorWindow.GetWindow(
3455+
typeof(BRT_BuildReportWindow),
3456+
false,
3457+
EDITOR_WINDOW_TITLE,
3458+
true
3459+
);
3460+
3461+
if (brtWindow != null)
34503462
{
3451-
//BRT_BuildReportWindow window = ScriptableObject.CreateInstance<BRT_BuildReportWindow>();
3452-
//window.ShowUtility();
3453-
3454-
//Debug.Log("showing build report window...");
3455-
3456-
//BRT_BuildReportWindow brtWindow = EditorWindow.GetWindow<BRT_BuildReportWindow>("Build Report", true, typeof(SceneView));
3457-
BRT_BuildReportWindow brtWindow = (BRT_BuildReportWindow)
3458-
EditorWindow.GetWindow(
3459-
typeof(BRT_BuildReportWindow),
3460-
false,
3461-
EDITOR_WINDOW_TITLE,
3462-
true
3463-
);
3464-
//BRT_BuildReportWindow brtWindow = EditorWindow.GetWindow(typeof(BRT_BuildReportWindow), false, "Build Report", true) as BRT_BuildReportWindow;
34653463
brtWindow.Init(_lastKnownBuildInfo);
34663464
}
3465+
else
3466+
{
3467+
Debug.LogError("Failed to create BRT_BuildReportWindow instance");
3468+
}
3469+
}
3470+
catch (System.Exception ex)
3471+
{
3472+
// 记录详细的错误信息
3473+
Debug.LogError($"Failed to show build report window: {ex.ToString()}");
3474+
3475+
// 可选:显示用户友好的错误提示
3476+
EditorUtility.DisplayDialog(
3477+
"Error",
3478+
"Unable to display build report. Please check the console for details.",
3479+
"OK"
3480+
);
3481+
}
3482+
}
34673483
}
34683484
} // namespace BuildReportTool

Demo/Addressable/Assets/BuildReport/Scripts/Editor/ReportGeneration/BRT_ReportGenerator_PublicAPI.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
using UnityEditor;
1+
using UnityEditor;
22
using UnityEngine;
33

44
namespace BuildReportTool
@@ -192,5 +192,5 @@ public static string CreateReport(
192192

193193
return savedFilePath;
194194
}
195-
}
195+
}
196196
}

0 commit comments

Comments
 (0)