1
0
mirror of https://github.com/Siccity/xNode.git synced 2025-12-20 17:26:02 +08:00
xNode/Example/Nodes/Vector.cs
Thor Kramer Brigsted d3bb36fe0e Big update: Warning: Updating to this commit will break all node connections.
Internal NodePorts now uses dicts instead of lists. This is faster and more manageable.
Added instance ports.
Added Node.Ports, Node.Outputs, Node.Inputs, Node.InstanceOutputs, Node.InstanceInputs
Changed public GetInputByFieldName to GetInputValue and GetInputPort
2017-11-02 14:54:03 +01:00

15 lines
444 B
C#

using UnityEngine;
namespace BasicNodes {
public class Vector : Node {
[Input] public float x, y, z;
[Output] public Vector3 vector;
public override object GetValue(NodePort port) {
float x = GetInputValue<float>("x", this.x);
float y = GetInputValue<float>("y", this.y);
float z = GetInputValue<float>("z", this.z);
return new Vector3(x, y, z);
}
}
}