mirror of
https://github.com/Siccity/xNode.git
synced 2025-12-20 17:26:02 +08:00
Removed examples from master branch. You can find them on the Examples branch.
This commit is contained in:
parent
290aa040fa
commit
d352335a74
@ -1,9 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 3cfe6eabeed0aa44e8d9d54b308a461f
|
||||
folderAsset: yes
|
||||
timeCreated: 1505418316
|
||||
licenseType: Free
|
||||
DefaultImporter:
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@ -1,183 +0,0 @@
|
||||
%YAML 1.1
|
||||
%TAG !u! tag:unity3d.com,2011:
|
||||
--- !u!114 &11400000
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_PrefabParentObject: {fileID: 0}
|
||||
m_PrefabInternal: {fileID: 0}
|
||||
m_GameObject: {fileID: 0}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: a6399826e2c44b447b32a3ed06646162, type: 3}
|
||||
m_Name: ExampleNodeGraph
|
||||
m_EditorClassIdentifier:
|
||||
nodes:
|
||||
- {fileID: 114708853913061688}
|
||||
- {fileID: 114511978881715272}
|
||||
- {fileID: 114509033286994848}
|
||||
- {fileID: 114245496101350052}
|
||||
--- !u!114 &114245496101350052
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_PrefabParentObject: {fileID: 0}
|
||||
m_PrefabInternal: {fileID: 0}
|
||||
m_GameObject: {fileID: 0}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: 98f6f901f0da53142b79277ea3f42518, type: 3}
|
||||
m_Name: DisplayValue
|
||||
m_EditorClassIdentifier:
|
||||
graph: {fileID: 11400000}
|
||||
position: {x: -168, y: 8}
|
||||
ports:
|
||||
keys:
|
||||
- input
|
||||
values:
|
||||
- _fieldName: input
|
||||
_node: {fileID: 114245496101350052}
|
||||
_typeQualifiedName: System.Object, mscorlib, Version=2.0.0.0, Culture=neutral,
|
||||
PublicKeyToken=b77a5c561934e089
|
||||
connections:
|
||||
- fieldName: result
|
||||
node: {fileID: 114511978881715272}
|
||||
_direction: 0
|
||||
_connectionType: 1
|
||||
_dynamic: 1
|
||||
--- !u!114 &114509033286994848
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_PrefabParentObject: {fileID: 0}
|
||||
m_PrefabInternal: {fileID: 0}
|
||||
m_GameObject: {fileID: 0}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: 98f6f901f0da53142b79277ea3f42518, type: 3}
|
||||
m_Name: DisplayValue
|
||||
m_EditorClassIdentifier:
|
||||
graph: {fileID: 11400000}
|
||||
position: {x: 72, y: -72}
|
||||
ports:
|
||||
keys:
|
||||
- input
|
||||
values:
|
||||
- _fieldName: input
|
||||
_node: {fileID: 114509033286994848}
|
||||
_typeQualifiedName: System.Object, mscorlib, Version=2.0.0.0, Culture=neutral,
|
||||
PublicKeyToken=b77a5c561934e089
|
||||
connections:
|
||||
- fieldName: vector
|
||||
node: {fileID: 114708853913061688}
|
||||
_direction: 0
|
||||
_connectionType: 1
|
||||
_dynamic: 1
|
||||
--- !u!114 &114511978881715272
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_PrefabParentObject: {fileID: 0}
|
||||
m_PrefabInternal: {fileID: 0}
|
||||
m_GameObject: {fileID: 0}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: 19e541bba2a188f4a84c6f3718ee6d55, type: 3}
|
||||
m_Name: MathNode
|
||||
m_EditorClassIdentifier:
|
||||
graph: {fileID: 11400000}
|
||||
position: {x: -472, y: -120}
|
||||
ports:
|
||||
keys:
|
||||
- a
|
||||
- b
|
||||
- result
|
||||
values:
|
||||
- _fieldName: a
|
||||
_node: {fileID: 114511978881715272}
|
||||
_typeQualifiedName: System.Single, mscorlib, Version=2.0.0.0, Culture=neutral,
|
||||
PublicKeyToken=b77a5c561934e089
|
||||
connections: []
|
||||
_direction: 0
|
||||
_connectionType: 0
|
||||
_dynamic: 0
|
||||
- _fieldName: b
|
||||
_node: {fileID: 114511978881715272}
|
||||
_typeQualifiedName: System.Single, mscorlib, Version=2.0.0.0, Culture=neutral,
|
||||
PublicKeyToken=b77a5c561934e089
|
||||
connections: []
|
||||
_direction: 0
|
||||
_connectionType: 0
|
||||
_dynamic: 0
|
||||
- _fieldName: result
|
||||
_node: {fileID: 114511978881715272}
|
||||
_typeQualifiedName: System.Single, mscorlib, Version=2.0.0.0, Culture=neutral,
|
||||
PublicKeyToken=b77a5c561934e089
|
||||
connections:
|
||||
- fieldName: x
|
||||
node: {fileID: 114708853913061688}
|
||||
- fieldName: input
|
||||
node: {fileID: 114245496101350052}
|
||||
_direction: 1
|
||||
_connectionType: 0
|
||||
_dynamic: 0
|
||||
a: 6.48
|
||||
b: 7.59
|
||||
result: 14.07
|
||||
mathType: 0
|
||||
--- !u!114 &114708853913061688
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_PrefabParentObject: {fileID: 0}
|
||||
m_PrefabInternal: {fileID: 0}
|
||||
m_GameObject: {fileID: 0}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: 05559f4106850df4ab41776666216480, type: 3}
|
||||
m_Name: Vector
|
||||
m_EditorClassIdentifier:
|
||||
graph: {fileID: 11400000}
|
||||
position: {x: -168, y: -120}
|
||||
ports:
|
||||
keys:
|
||||
- x
|
||||
- y
|
||||
- z
|
||||
- vector
|
||||
values:
|
||||
- _fieldName: x
|
||||
_node: {fileID: 114708853913061688}
|
||||
_typeQualifiedName: System.Single, mscorlib, Version=2.0.0.0, Culture=neutral,
|
||||
PublicKeyToken=b77a5c561934e089
|
||||
connections:
|
||||
- fieldName: result
|
||||
node: {fileID: 114511978881715272}
|
||||
_direction: 0
|
||||
_connectionType: 0
|
||||
_dynamic: 0
|
||||
- _fieldName: y
|
||||
_node: {fileID: 114708853913061688}
|
||||
_typeQualifiedName: System.Single, mscorlib, Version=2.0.0.0, Culture=neutral,
|
||||
PublicKeyToken=b77a5c561934e089
|
||||
connections: []
|
||||
_direction: 0
|
||||
_connectionType: 0
|
||||
_dynamic: 0
|
||||
- _fieldName: z
|
||||
_node: {fileID: 114708853913061688}
|
||||
_typeQualifiedName: System.Single, mscorlib, Version=2.0.0.0, Culture=neutral,
|
||||
PublicKeyToken=b77a5c561934e089
|
||||
connections: []
|
||||
_direction: 0
|
||||
_connectionType: 0
|
||||
_dynamic: 0
|
||||
- _fieldName: vector
|
||||
_node: {fileID: 114708853913061688}
|
||||
_typeQualifiedName: UnityEngine.Vector3, UnityEngine.CoreModule, Version=0.0.0.0,
|
||||
Culture=neutral, PublicKeyToken=null
|
||||
connections:
|
||||
- fieldName: input
|
||||
node: {fileID: 114509033286994848}
|
||||
_direction: 1
|
||||
_connectionType: 0
|
||||
_dynamic: 0
|
||||
x: 0
|
||||
y: 2.6412349
|
||||
z: 14.33477
|
||||
vector: {x: 14.07, y: 2.6412349, z: 14.33477}
|
||||
@ -1,10 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: cee47fa32ae90bb4f8f0bec6f186cb3b
|
||||
timeCreated: 1509308927
|
||||
licenseType: Free
|
||||
NativeFormatImporter:
|
||||
externalObjects: {}
|
||||
mainObjectFileID: 11400000
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@ -1,8 +0,0 @@
|
||||
using UnityEngine;
|
||||
using System;
|
||||
using XNode;
|
||||
|
||||
/// <summary> Defines an example nodegraph. </summary>
|
||||
[Serializable, CreateAssetMenu(fileName = "ExampleNodeGraph", menuName = "Node Graph/Example")]
|
||||
public class ExampleNodeGraph : XNode.NodeGraph {
|
||||
}
|
||||
@ -1,12 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: a6399826e2c44b447b32a3ed06646162
|
||||
timeCreated: 1506460823
|
||||
licenseType: Free
|
||||
MonoImporter:
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@ -1,9 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 31c1681f5df4f764ab4ca7f09cd3be7d
|
||||
folderAsset: yes
|
||||
timeCreated: 1505462700
|
||||
licenseType: Free
|
||||
DefaultImporter:
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@ -1,14 +0,0 @@
|
||||
using XNode;
|
||||
|
||||
namespace BasicNodes {
|
||||
public class DisplayValue : XNode.Node {
|
||||
protected override void Init() {
|
||||
base.Init();
|
||||
if (!HasPort("input")) AddInstanceInput(typeof(object), ConnectionType.Override ,"input");
|
||||
}
|
||||
|
||||
public override object GetValue(XNode.NodePort port) {
|
||||
return GetInputValue<object>("input");
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -1,12 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 98f6f901f0da53142b79277ea3f42518
|
||||
timeCreated: 1507499149
|
||||
licenseType: Free
|
||||
MonoImporter:
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@ -1,10 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 0d2300267781fed46a6d964565309cbf
|
||||
folderAsset: yes
|
||||
timeCreated: 1509307735
|
||||
licenseType: Free
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@ -1,15 +0,0 @@
|
||||
using UnityEditor;
|
||||
using XNodeEditor;
|
||||
|
||||
namespace BasicNodes {
|
||||
[CustomNodeEditor(typeof(DisplayValue))]
|
||||
public class DisplayValueEditor : NodeEditor {
|
||||
|
||||
public override void OnBodyGUI() {
|
||||
base.OnBodyGUI();
|
||||
NodeEditorGUILayout.PortField(target.GetInputPort("input"));
|
||||
object obj = target.GetValue(null);
|
||||
if (obj != null) EditorGUILayout.LabelField(obj.ToString());
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -1,13 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 7d7298690665789498dc42a285eb2c28
|
||||
timeCreated: 1509305659
|
||||
licenseType: Free
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@ -1,35 +0,0 @@
|
||||
using XNode;
|
||||
|
||||
namespace BasicNodes {
|
||||
[System.Serializable]
|
||||
public class MathNode : XNode.Node {
|
||||
// Adding [Input] or [Output] is all you need to do to register a field as a valid port on your node
|
||||
[Input] public float a;
|
||||
[Input] public float b;
|
||||
// The value of an output node field is not used for anything, but could be used for caching output results
|
||||
[Output] public float result;
|
||||
|
||||
// Will be displayed as an editable field - just like the normal inspector
|
||||
public MathType mathType = MathType.Add;
|
||||
public enum MathType { Add, Subtract, Multiply, Divide }
|
||||
|
||||
// GetValue should be overridden to return a value for any specified output port
|
||||
public override object GetValue(XNode.NodePort port) {
|
||||
|
||||
// Get new a and b values from input connections. Fallback to field values if input is not connected
|
||||
float a = GetInputValue<float>("a", this.a);
|
||||
float b = GetInputValue<float>("b", this.b);
|
||||
|
||||
// After you've gotten your input values, you can perform your calculations and return a value
|
||||
result = 0f;
|
||||
if (port.fieldName == "result")
|
||||
switch (mathType) {
|
||||
case MathType.Add: default: result = a+b; break;
|
||||
case MathType.Subtract: result = a - b; break;
|
||||
case MathType.Multiply: result = a * b; break;
|
||||
case MathType.Divide: result = a / b; break;
|
||||
}
|
||||
return result;
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -1,13 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 19e541bba2a188f4a84c6f3718ee6d55
|
||||
timeCreated: 1509307779
|
||||
licenseType: Free
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@ -1,16 +0,0 @@
|
||||
using UnityEngine;
|
||||
using XNode;
|
||||
|
||||
namespace BasicNodes {
|
||||
public class Vector : XNode.Node {
|
||||
[Input] public float x, y, z;
|
||||
[Output] public Vector3 vector;
|
||||
|
||||
public override object GetValue(XNode.NodePort port) {
|
||||
vector.x = GetInputValue<float>("x", this.x);
|
||||
vector.y = GetInputValue<float>("y", this.y);
|
||||
vector.z = GetInputValue<float>("z", this.z);
|
||||
return vector;
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -1,13 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 05559f4106850df4ab41776666216480
|
||||
timeCreated: 1509303406
|
||||
licenseType: Free
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
Loading…
x
Reference in New Issue
Block a user