Merge pull request #6 from LiuOcean/main

Add Group Window Undo Redo
pull/7/head^2^2
何冠峰 2022-04-26 19:13:04 +08:00 committed by GitHub
commit 0a4a3d8f2e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 6 additions and 0 deletions

View File

@ -32,6 +32,9 @@ namespace YooAsset.Editor
public void CreateGUI() public void CreateGUI()
{ {
Undo.undoRedoPerformed -= RefreshWindow;
Undo.undoRedoPerformed += RefreshWindow;
VisualElement root = this.rootVisualElement; VisualElement root = this.rootVisualElement;
_packRuleList = AssetBundleGrouperSettingData.GetPackRuleNames(); _packRuleList = AssetBundleGrouperSettingData.GetPackRuleNames();
@ -221,6 +224,7 @@ namespace YooAsset.Editor
} }
private void AddGrouperBtn_clicked() private void AddGrouperBtn_clicked()
{ {
Undo.RecordObject(AssetBundleGrouperSettingData.Setting, "YooAsset AddGrouper");
AssetBundleGrouperSettingData.CreateGrouper("Default Grouper", string.Empty, string.Empty); AssetBundleGrouperSettingData.CreateGrouper("Default Grouper", string.Empty, string.Empty);
FillGrouperViewData(); FillGrouperViewData();
} }
@ -230,6 +234,8 @@ namespace YooAsset.Editor
if (selectGrouper == null) if (selectGrouper == null)
return; return;
Undo.RecordObject(AssetBundleGrouperSettingData.Setting, "YooAsset RemoveGrouper");
AssetBundleGrouperSettingData.RemoveGrouper(selectGrouper); AssetBundleGrouperSettingData.RemoveGrouper(selectGrouper);
FillGrouperViewData(); FillGrouperViewData();
} }