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.

[NodeColor("#76FFAE")]

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

[NodeColor("#76FFAE", new string[]{"", "#FFFFFF", "", ""})]

NodeDescription

[NodeDescription("This is a description for my node")]

Set a description for your node

NodeOutputs

[NodeOutputs(new string[] {"A", "B", "C"})}

Define the node outputs.

NodeSize

[NodeSize(200, 100)]

Set the node size

NodeNotConnectable

[NodeNotConnectable]

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

NodeAddOutputsUI

[NodeAddOutputsUI]

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

HideNode

[HideNode]

Hide the node from the node creation panel

NodeInputConnectionType

[NodeInputConnectionType(new Type[]{typeof(CustomNodeType)}]

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

NodeOutputConnectionType

[NodeOutputConnectionType(new Type[] {typeof(CustomNodeType)}]

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

Node3LinesSpline

[Node3LinesSpline]

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

Last updated