Added the functionality to add RelayNode directly to edge between two Prot;

This commit is contained in:
Misaki
2024-11-07 00:42:52 +09:00
parent 02ae77f17a
commit 5ac1081d32
16 changed files with 243 additions and 150 deletions

View File

@@ -10,7 +10,7 @@ using UnityEngine.UIElements;
namespace Misaki.GraphView.Editor
{
public class ExecutableNodeView : Node, IInspectable, IPortContainer
public class ExecutableNodeView : Node, IInspectable, IPortContainer, IDataNodeView<ExecutableNode>
{
private readonly ExecutableNode _dataNode;
private readonly Type _nodeType;
@@ -24,6 +24,9 @@ namespace Misaki.GraphView.Editor
private readonly VisualElement _logContainer = new();
public ExecutableNode DataNode => _dataNode;
public DataNode GetDataNode() => _dataNode;
public Action<IInspectable> OnItemSelected
{
get; set;
@@ -194,12 +197,6 @@ namespace Misaki.GraphView.Editor
_outputPorts.Add(outputPort);
}
public override void SetPosition(Rect newPos)
{
base.SetPosition(newPos);
_dataNode.position = newPos;
}
public override void OnSelected()
{
base.OnSelected();