update extension sample

PanelMonitor增加控制开关
dev
何冠峰 2025-04-23 16:39:07 +08:00
parent 9b0bebd981
commit e674d5bf97
1 changed files with 9 additions and 1 deletions

View File

@ -6,6 +6,11 @@ using UnityEngine.U2D;
public static class UIPanelSettings public static class UIPanelSettings
{ {
/// <summary>
/// 是否开启面板监测
/// </summary>
public static bool EnablePanelMonitor = false;
/// <summary> /// <summary>
/// 面板文件夹GUID /// 面板文件夹GUID
/// </summary> /// </summary>
@ -60,6 +65,9 @@ public class UIPanelMonitor : UnityEditor.Editor
static void OnPrefabSaving(GameObject go) static void OnPrefabSaving(GameObject go)
{ {
if (UIPanelSettings.EnablePanelMonitor == false)
return;
UnityEditor.SceneManagement.PrefabStage stage = UnityEditor.SceneManagement.PrefabStageUtility.GetCurrentPrefabStage(); UnityEditor.SceneManagement.PrefabStage stage = UnityEditor.SceneManagement.PrefabStageUtility.GetCurrentPrefabStage();
if (stage != null) if (stage != null)
{ {
@ -78,7 +86,7 @@ public class UIPanelMonitor : UnityEditor.Editor
/// <summary> /// <summary>
/// 刷新面板清单 /// 刷新面板清单
/// </summary> /// </summary>
public static void RefreshPanelManifest(PanelManifest manifest) private static void RefreshPanelManifest(PanelManifest manifest)
{ {
manifest.ReferencesAtlas.Clear(); manifest.ReferencesAtlas.Clear();