- Cleanup and comments

This commit is contained in:
Nils Hausfeld
2023-10-05 18:11:08 +02:00
parent d7ade326a9
commit dc6a2d4d25
2 changed files with 10 additions and 1 deletions

View File

@@ -838,6 +838,10 @@ namespace FlaxEditor.Surface.Archetypes
box.CurrentType = type ? type : ScriptType.FlaxObject;
}
/// <summary>
/// Sets the type of the picker and the type of the output box
/// </summary>
/// <param name="type">Target Type</param>
public void SetPickerValue(ScriptType type)
{
_picker.Value = type;
@@ -1004,6 +1008,10 @@ namespace FlaxEditor.Surface.Archetypes
GetBox(4).CurrentType = type ? type : _picker.Type;
}
/// <summary>
/// Sets the type of the picker and the type of the output box
/// </summary>
/// <param name="type">Target Type</param>
public void SetPickerValue(ScriptType type)
{
_picker.Value = type;

View File

@@ -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);