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

@@ -1,21 +1,21 @@
using UnityEditor.Experimental.GraphView;
using UnityEngine;
using UnityEngine.UIElements;
namespace Misaki.GraphView.Editor
{
public class PropertyInputNodeView : TokenNode, IPortContainer
public class PropertyInputNodeView : TokenNode, IPortContainer, IDataNodeView<PropertyInput>
{
private readonly Port _outputPort;
private readonly PropertyInput _data;
private readonly PropertyInput _dataNode;
//private readonly ExposedPropertyEditor _editor;
public PropertyInput Data => _data;
public PropertyInput DataNode => _dataNode;
public DataNode GetDataNode() => _dataNode;
public PropertyInputNodeView(PropertyInput data, Port output) : base(null, output)
{
_data = data;
_dataNode = data;
_outputPort = output;
name = data.Property.propertyName;
@@ -60,13 +60,7 @@ namespace Misaki.GraphView.Editor
return port;
}
public string InspectorName => _data.Property.propertyName;
public override void SetPosition(Rect newPos)
{
base.SetPosition(newPos);
_data.position = newPos;
}
public string InspectorName => _dataNode.Property.propertyName;
public Port GetPort(int index, Direction direction)
{