Added IExecutable and ISlotContainer interface.

Changed SlotContainerNode to ExecutableNode
This commit is contained in:
Misaki
2024-11-05 02:25:15 +09:00
parent 7eec130b39
commit c853994bf5
51 changed files with 443 additions and 400 deletions

View File

@@ -5,7 +5,7 @@ using Misaki.GraphView.Editor;
namespace Misaki.GraphView.Sample
{
[NodeInfo("Add", "Math")]
public class AddNode : BackTraceNode
public class Add : BackTraceExecutableNode
{
[NodeInput]
#if UNITY_EDITOR

View File

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

View File

@@ -3,7 +3,7 @@ using UnityEngine;
namespace Misaki.GraphView.Sample
{
[NodeInfo("Output Node", "Output")]
public class OutputNode : BackTraceNode
public class Output : BackTraceExecutableNode
{
[NodeInput]
private float _input;