-
Notifications
You must be signed in to change notification settings - Fork 5
Custom Nodes
Mefodei edited this page Feb 18, 2020
·
2 revisions
Define you own custom node is easy. All you need is create new class and extend UniNode base class
[CreateNodeMenu("Examples/SimpleCustomNodes/SimpleDemoNode",nodeName = "Simple Node")]
public class SimpleDemoNode: UniNode
{
}
After that your node would be look like
Hm...No so pretty as you imagine, i think. But now we can add several additional parameters to our node.
[CreateNodeMenu("Examples/SimpleCustomNodes/SimpleDemoNode",nodeName = "Simple Node")]
public class SimpleDemoNode: UniNode
{
[SerializeField]
private int intDataOne;
public int intDataTwo;
}
But there is still no way to data connection. Let's fix that!
[CreateNodeMenu("Examples/SimpleCustomNodes/SimpleNode",nodeName = "Simple Node")]
public class SimpleDemoNode : UniNode
{
[SerializeField]
private int intDataOne;
public int intDataTwo;
[PortValue(PortIO.Input)]
public int inInt;
[PortValue(PortIO.Output)]
public float outInt;
}