Add refreshing actively opened Layers And Tags asset editor when adding tags from popup

#885
This commit is contained in:
Wojciech Figat
2023-01-16 12:11:04 +01:00
parent 5dd91d0cdc
commit 5babe8df3f
2 changed files with 11 additions and 0 deletions

View File

@@ -257,6 +257,9 @@ namespace FlaxEditor.CustomEditors.Editors
var settingsObj = (LayersAndTagsSettings)settingsAsset.Instance;
settingsObj.Tags.Add(tagName);
settingsAsset.SetInstance(settingsObj);
// Reload editor window to reflect new tag
assetWindow?.RefreshAsset();
}
};
dialog.Closed += popup =>

View File

@@ -308,6 +308,14 @@ namespace FlaxEditor.Windows.Assets
{
}
/// <summary>
/// Drops any loaded asset data and refreshes the UI state.
/// </summary>
public void RefreshAsset()
{
_isWaitingForLoaded = true;
}
/// <summary>
/// Reloads the asset (window will receive <see cref="OnAssetLoaded"/> or <see cref="OnAssetLoadFailed"/> events).
/// </summary>