From dc6a2d4d256f0ab20fad90bb223ddec634ea30fb Mon Sep 17 00:00:00 2001 From: Nils Hausfeld Date: Thu, 5 Oct 2023 18:11:08 +0200 Subject: [PATCH] - Cleanup and comments --- Source/Editor/Surface/Archetypes/Tools.cs | 8 ++++++++ Source/Editor/Surface/Elements/Box.cs | 3 ++- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/Source/Editor/Surface/Archetypes/Tools.cs b/Source/Editor/Surface/Archetypes/Tools.cs index cacb7e910..201a29418 100644 --- a/Source/Editor/Surface/Archetypes/Tools.cs +++ b/Source/Editor/Surface/Archetypes/Tools.cs @@ -838,6 +838,10 @@ namespace FlaxEditor.Surface.Archetypes box.CurrentType = type ? type : ScriptType.FlaxObject; } + /// + /// Sets the type of the picker and the type of the output box + /// + /// Target Type public void SetPickerValue(ScriptType type) { _picker.Value = type; @@ -1004,6 +1008,10 @@ namespace FlaxEditor.Surface.Archetypes GetBox(4).CurrentType = type ? type : _picker.Type; } + /// + /// Sets the type of the picker and the type of the output box + /// + /// Target Type public void SetPickerValue(ScriptType type) { _picker.Value = type; diff --git a/Source/Editor/Surface/Elements/Box.cs b/Source/Editor/Surface/Elements/Box.cs index 445a2f1e8..87cafd64b 100644 --- a/Source/Editor/Surface/Elements/Box.cs +++ b/Source/Editor/Surface/Elements/Box.cs @@ -2,7 +2,6 @@ using System; using System.Collections.Generic; -using System.Linq; using FlaxEditor.Scripting; using FlaxEditor.Surface.Undo; using FlaxEngine; @@ -843,6 +842,7 @@ namespace FlaxEditor.Surface.Elements throw new NullReferenceException("Casting failed. Cast node is invalid!"); } + // We set the position of the cast node here to set it relative to the target nodes input box undoEnabled = castNode.Surface.Undo.Enabled; castNode.Surface.Undo.Enabled = false; var wantedOffset = iB.ParentNode.Location - new Float2(casterXOffset, -(iB.LocalY - castOutputBox.LocalY)); @@ -876,6 +876,7 @@ namespace FlaxEditor.Surface.Elements throw new NullReferenceException("Casting failed. Cast node is invalid!"); } + // We set the position of the cast node here to set it relative to the target nodes input box var wantedOffset = iB.ParentNode.Location - new Float2(casterXOffset, -(iB.LocalY - castOutputBox.LocalY)); castNode.Location = Surface.Root.PointFromParent(ref wantedOffset);