Updated RelayNode;
Added ISlot interface; Added ProxySlot;
This commit is contained in:
@@ -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()
|
||||
|
||||
@@ -1,8 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: eb7bc6eed66a1dd4ca8c71908a3b3874
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -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();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,2 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: a761276bd0f3a4a4cb4b0894d193f4cd
|
||||
@@ -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}");
|
||||
|
||||
Reference in New Issue
Block a user