Fix property value sliders usage in BT editor

This commit is contained in:
Wojtek Figat
2023-08-20 21:40:03 +02:00
parent eee53dfbdc
commit a44c1521af
2 changed files with 17 additions and 1 deletions

View File

@@ -61,7 +61,7 @@ namespace FlaxEditor.Windows.Assets
_undo = new Undo();
_undo.UndoDone += OnUndoRedo;
_undo.RedoDone += OnUndoRedo;
_undo.ActionDone += OnUndoRedo;
_undo.ActionDone += OnUndoAction;
// Split Panels
_split1 = new SplitPanel(Orientation.Horizontal, ScrollBars.None, ScrollBars.None)
@@ -120,6 +120,12 @@ namespace FlaxEditor.Windows.Assets
_nodePropertiesEditor.BuildLayoutOnUpdate();
}
private void OnUndoAction(IUndoAction action)
{
MarkAsEdited();
UpdateToolstrip();
}
private void OnNodeSelectionChanged()
{
// Select node instances to view/edit
@@ -149,7 +155,9 @@ namespace FlaxEditor.Windows.Assets
{
if (nodes[j] is Surface.Archetypes.BehaviorTree.Node node && node.Instance == instance)
{
node._isValueEditing = true;
node.SetValue(1, FlaxEngine.Json.JsonSerializer.SaveToBytes(instance));
node._isValueEditing = false;
break;
}
}