First commit
This commit is contained in:
3
Sample/Runtime/ExposedProperty.meta
Normal file
3
Sample/Runtime/ExposedProperty.meta
Normal file
@@ -0,0 +1,3 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 123b16431f374c7ab3b89c37866a9ea9
|
||||
timeCreated: 1730458328
|
||||
18
Sample/Runtime/ExposedProperty/FloatProperty.cs
Normal file
18
Sample/Runtime/ExposedProperty/FloatProperty.cs
Normal file
@@ -0,0 +1,18 @@
|
||||
using System;
|
||||
|
||||
namespace Misaki.GraphView.Sample
|
||||
{
|
||||
[Serializable]
|
||||
public class FloatProperty : ExposedProperty
|
||||
{
|
||||
public float value;
|
||||
|
||||
public override object Value
|
||||
{
|
||||
get => value;
|
||||
set => this.value = (float) value;
|
||||
}
|
||||
|
||||
public override Type GetValueType() => typeof(float);
|
||||
}
|
||||
}
|
||||
3
Sample/Runtime/ExposedProperty/FloatProperty.cs.meta
Normal file
3
Sample/Runtime/ExposedProperty/FloatProperty.cs.meta
Normal file
@@ -0,0 +1,3 @@
|
||||
fileFormatVersion: 2
|
||||
guid: bdcf54264961455791242e8bbc7400c1
|
||||
timeCreated: 1730458344
|
||||
17
Sample/Runtime/GraphView.Sample.asmdef
Normal file
17
Sample/Runtime/GraphView.Sample.asmdef
Normal file
@@ -0,0 +1,17 @@
|
||||
{
|
||||
"name": "GraphView.Sample",
|
||||
"rootNamespace": "Misaki.GraphView.Sample",
|
||||
"references": [
|
||||
"GUID:f9745e3c5d586134288023f609b080e2",
|
||||
"GUID:533d7c0252a224f4b91c72a79c31c026"
|
||||
],
|
||||
"includePlatforms": [],
|
||||
"excludePlatforms": [],
|
||||
"allowUnsafeCode": false,
|
||||
"overrideReferences": false,
|
||||
"precompiledReferences": [],
|
||||
"autoReferenced": true,
|
||||
"defineConstraints": [],
|
||||
"versionDefines": [],
|
||||
"noEngineReferences": false
|
||||
}
|
||||
7
Sample/Runtime/GraphView.Sample.asmdef.meta
Normal file
7
Sample/Runtime/GraphView.Sample.asmdef.meta
Normal file
@@ -0,0 +1,7 @@
|
||||
fileFormatVersion: 2
|
||||
guid: ccfdc692d87db8b49b9ec88c2ec0ab79
|
||||
AssemblyDefinitionImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
8
Sample/Runtime/Nodes.meta
Normal file
8
Sample/Runtime/Nodes.meta
Normal file
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 17b084c90754ea04595455524a3e6286
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
30
Sample/Runtime/Nodes/AddNode.cs
Normal file
30
Sample/Runtime/Nodes/AddNode.cs
Normal file
@@ -0,0 +1,30 @@
|
||||
#if UNITY_EDITOR
|
||||
using Misaki.GraphView.Editor;
|
||||
#endif
|
||||
|
||||
namespace Misaki.GraphView.Sample
|
||||
{
|
||||
[NodeInfo("Add", "Math")]
|
||||
public class AddNode : BackTraceBaseNode
|
||||
{
|
||||
[NodeInput]
|
||||
#if UNITY_EDITOR
|
||||
[InspectorInput]
|
||||
#endif
|
||||
public float a;
|
||||
|
||||
[NodeInput]
|
||||
#if UNITY_EDITOR
|
||||
[InspectorInput]
|
||||
#endif
|
||||
public float b;
|
||||
|
||||
[NodeOutput]
|
||||
private float _result;
|
||||
|
||||
protected override void OnExecute()
|
||||
{
|
||||
_result = a + b;
|
||||
}
|
||||
}
|
||||
}
|
||||
2
Sample/Runtime/Nodes/AddNode.cs.meta
Normal file
2
Sample/Runtime/Nodes/AddNode.cs.meta
Normal file
@@ -0,0 +1,2 @@
|
||||
fileFormatVersion: 2
|
||||
guid: fe1c51aa37dba09468a65f5594146083
|
||||
8
Sample/Runtime/Nodes/BaseClasses.meta
Normal file
8
Sample/Runtime/Nodes/BaseClasses.meta
Normal file
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: eb7bc6eed66a1dd4ca8c71908a3b3874
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
16
Sample/Runtime/Nodes/BaseClasses/BackTraceBaseNode.cs
Normal file
16
Sample/Runtime/Nodes/BaseClasses/BackTraceBaseNode.cs
Normal file
@@ -0,0 +1,16 @@
|
||||
namespace Misaki.GraphView.Sample
|
||||
{
|
||||
public abstract class BackTraceBaseNode : BaseNode
|
||||
{
|
||||
protected override void OnPullData(Slot input)
|
||||
{
|
||||
if (input.LinkedSlotData.Count == 0)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
var outputNode = GraphObject.GetNode(input.LinkedSlotData[0].nodeID);
|
||||
outputNode.Execute();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,2 @@
|
||||
fileFormatVersion: 2
|
||||
guid: a761276bd0f3a4a4cb4b0894d193f4cd
|
||||
16
Sample/Runtime/Nodes/OutputNode.cs
Normal file
16
Sample/Runtime/Nodes/OutputNode.cs
Normal file
@@ -0,0 +1,16 @@
|
||||
using UnityEngine;
|
||||
|
||||
namespace Misaki.GraphView.Sample
|
||||
{
|
||||
[NodeInfo("Output Node", "Output")]
|
||||
public class OutputNode : BackTraceBaseNode
|
||||
{
|
||||
[NodeInput]
|
||||
private float _input;
|
||||
|
||||
protected override void OnExecute()
|
||||
{
|
||||
Debug.Log(_input);
|
||||
}
|
||||
}
|
||||
}
|
||||
2
Sample/Runtime/Nodes/OutputNode.cs.meta
Normal file
2
Sample/Runtime/Nodes/OutputNode.cs.meta
Normal file
@@ -0,0 +1,2 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 42ed2641b4fc11240be0abda76236178
|
||||
21
Sample/Runtime/SampleGraphAsset.cs
Normal file
21
Sample/Runtime/SampleGraphAsset.cs
Normal file
@@ -0,0 +1,21 @@
|
||||
using UnityEngine;
|
||||
|
||||
namespace Misaki.GraphView.Sample
|
||||
{
|
||||
[CreateAssetMenu(fileName = "GraphAsset", menuName = "Scriptable Objects/GraphAsset")]
|
||||
public class SampleGraphAsset : GraphObject
|
||||
{
|
||||
public override void Execute()
|
||||
{
|
||||
Nodes.ClearAllExecuteFlag();
|
||||
|
||||
foreach (var node in Nodes)
|
||||
{
|
||||
if (node is OutputNode outputNode)
|
||||
{
|
||||
outputNode.Execute();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
2
Sample/Runtime/SampleGraphAsset.cs.meta
Normal file
2
Sample/Runtime/SampleGraphAsset.cs.meta
Normal file
@@ -0,0 +1,2 @@
|
||||
fileFormatVersion: 2
|
||||
guid: a6ff09617d9e7ad4db1c77355ecb6ee1
|
||||
Reference in New Issue
Block a user