pull/229/head
hevinci 2023-12-26 11:40:47 +08:00
parent 2838289650
commit 67b2b886a8
1 changed files with 9 additions and 3 deletions

View File

@ -65,9 +65,6 @@ namespace YooAsset.Editor
public void CreateGUI()
{
Undo.undoRedoPerformed -= RefreshWindow;
Undo.undoRedoPerformed += RefreshWindow;
try
{
_collectorTypeList = new List<string>()
@ -347,6 +344,15 @@ namespace YooAsset.Editor
Debug.LogError(e.ToString());
}
}
public void OnEnable()
{
Undo.undoRedoPerformed += RefreshWindow;
}
public void OnDisable()
{
if (Undo.undoRedoPerformed != null)
Undo.undoRedoPerformed -= RefreshWindow;
}
public void OnDestroy()
{
// 注意:清空所有撤销操作