Updated RelayNode;

Added ISlot interface;
Added ProxySlot;
This commit is contained in:
Misaki
2024-11-08 20:56:19 +09:00
parent e15570459c
commit 994297a3f2
22 changed files with 426 additions and 268 deletions

View File

@@ -5,7 +5,7 @@ using Misaki.GraphView.Editor;
namespace Misaki.GraphView.Sample
{
[NodeInfo("Add", "Math")]
public class Add : BackTraceExecutableNode
public class Add : ExecutableNode
{
[NodeInput]
#if UNITY_EDITOR
@@ -19,7 +19,7 @@ namespace Misaki.GraphView.Sample
#endif
public float b;
[NodeOutput]
[NodeOutput]
private float _result;
protected override bool OnExecute()

View File

@@ -1,8 +0,0 @@
fileFormatVersion: 2
guid: eb7bc6eed66a1dd4ca8c71908a3b3874
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -1,19 +0,0 @@
namespace Misaki.GraphView.Sample
{
public abstract class BackTraceExecutableNode : ExecutableNode
{
protected override void OnPullData(Slot input)
{
if (input.LinkedSlotData.Count == 0)
{
return;
}
var outputNode = GraphObject.GetNode(input.LinkedSlotData[0].nodeID);
if (outputNode is IExecutable executable)
{
executable.Execute();
}
}
}
}

View File

@@ -1,2 +0,0 @@
fileFormatVersion: 2
guid: a761276bd0f3a4a4cb4b0894d193f4cd

View File

@@ -1,13 +1,11 @@
using UnityEngine;
namespace Misaki.GraphView.Sample
{
[NodeInfo("Output Node", "Output")]
public class Output : BackTraceExecutableNode
public class Output : ExecutableNode
{
[NodeInput]
private float _input;
protected override bool OnExecute()
{
GraphObject.Logger.LogInfo(this, $"{_input}");