From 66c3c4862ac7659ce7ff9877cfcb9f63b30a3323 Mon Sep 17 00:00:00 2001 From: L <401419353@qq.com> Date: Tue, 26 Apr 2022 12:48:24 +0800 Subject: [PATCH] Add Group Window Undo Redo --- .../Editor/AssetBundleGrouper/AssetBundleGrouperWindow.cs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/Assets/YooAsset/Editor/AssetBundleGrouper/AssetBundleGrouperWindow.cs b/Assets/YooAsset/Editor/AssetBundleGrouper/AssetBundleGrouperWindow.cs index e65adfa..b0dda56 100644 --- a/Assets/YooAsset/Editor/AssetBundleGrouper/AssetBundleGrouperWindow.cs +++ b/Assets/YooAsset/Editor/AssetBundleGrouper/AssetBundleGrouperWindow.cs @@ -32,6 +32,9 @@ namespace YooAsset.Editor public void CreateGUI() { + Undo.undoRedoPerformed -= RefreshWindow; + Undo.undoRedoPerformed += RefreshWindow; + VisualElement root = this.rootVisualElement; _packRuleList = AssetBundleGrouperSettingData.GetPackRuleNames(); @@ -221,6 +224,7 @@ namespace YooAsset.Editor } private void AddGrouperBtn_clicked() { + Undo.RecordObject(AssetBundleGrouperSettingData.Setting, "YooAsset AddGrouper"); AssetBundleGrouperSettingData.CreateGrouper("Default Grouper", string.Empty, string.Empty); FillGrouperViewData(); } @@ -230,6 +234,8 @@ namespace YooAsset.Editor if (selectGrouper == null) return; + Undo.RecordObject(AssetBundleGrouperSettingData.Setting, "YooAsset RemoveGrouper"); + AssetBundleGrouperSettingData.RemoveGrouper(selectGrouper); FillGrouperViewData(); }