Node Attributes

You can add mutliple attributes to your node class to define the node properties

[NodeTitle("My Node")]
[NodeCategory("Custom")]
[NodeOutputs(new string[] {"Out"})]
[NodeDescription("This is a node description")]
public class MyNode : NodeData

NodeTitle

[NodeTitle("My Node")]

Define the title of your node

NodeCategory

[NodeCategory("Category A/Sub-Category")]

Set the category of your node

You can also define sub-categories with a backslash. (example: Unity/Physics)

NodeIcon

Set an icon for your node, either by assigning the name of an icon from the icons folder located at Databrain / Core / Res / Icons or by assigning a complete asset path like: Assets/MyNodes/Icons/nodeIcon.png or by assigning an additional file name which is located in the same folder as the icon.

[NodeIcon("start")]
[NodeIcon("myCustomIcon.png", "CustomIcons.cs")]

NodeColor

Define the color of your node. Either by a hex color string or by a DatabrainColor.

You can also define custom colors for each border (left, right, top, bottom)

NodeDescription

Set a description for your node

NodeOutputs

Define the node outputs.

NodeSize

Set the node size

NodeNotConnectable

This attribute makes the node not connectable like the OnStart node.

NodeAddOutputsUI

This will add a simple UI to the node inspector which allows you to manually add and remove outputs.

HideNode

Hide the node from the node creation panel

NodeInputConnectionType

Define which nodes are allowed to be connected to the input of the node.

NodeOutputConnectionType

Define to which node types the output can be connected to.

Node3LinesSpline

Creates a three lines connection spline type instead of just one single spline.

Last updated