Add JsonAsset.Save to fix saving new tag

#885
This commit is contained in:
Wojtek Figat
2023-02-16 14:32:52 +01:00
parent 123b7f5433
commit 969053a240
5 changed files with 105 additions and 88 deletions

View File

@@ -174,9 +174,7 @@ namespace FlaxEditor.CustomEditors.Editors
for (int i = 0; i < subInputs.Length; i++)
{
if (string.IsNullOrEmpty(subInputs[i]))
{
continue;
}
// Check all entered subtags and create any that dont exist
for (int j = 0; j <= i; j++)
@@ -296,6 +294,7 @@ namespace FlaxEditor.CustomEditors.Editors
settingsObj.Tags.Add(tagName);
settingsObj.Tags.Sort();
settingsAsset.SetInstance(settingsObj);
settingsAsset.Save();
// Reload editor window to reflect new tag
assetWindow?.RefreshAsset();
@@ -417,7 +416,6 @@ namespace FlaxEditor.CustomEditors.Editors
{
if (!uniqueText)
return;
OnAddTagButtonClicked(nameTextBox.Text, tree, nameTextBox, addTagDropPanel, pickerData);
};