Nodes
Nodes are units of logic that can be connected together to create complex behaviors. They can be thought as functions in a program but with a visual representation.
Type Definition
You can create node types that can be instantiated and stored in a blueprint. A node type inherits from the Node type and is decorated with the [NodeType] attribute, like below:
using Warudo.Core.Attributes;
using Warudo.Core.Graphs;
[NodeType(
Id = "c76b2fef-a7e7-4299-b942-e0b6dec52660",
Title = "Hello World",
Category = "CATEGORY_DEBUG",
Width = 1f
)]
public class HelloWorldNode : Node {
// Node implementation
}
Here's a summary of the parameters:
| Parameters | Type | Data Type | Description |
|---|---|---|---|
Id | Mandatory | string | The unique identifier of this node class. You should generate a new GUID for each new node type. Note: the Id of the node class is different from the UUID of a node instance (node.Id). |
Title | Optional | string | The name of this node that will be displayed in the node palette. |
Category | Optional | string | The group of this node in the node palette. |
Width | Optional | float | The width of this node, which is by default 1f. A node with a width of 2f will take up twice the space of a node with a width of 1f. |
About Category
- You can use the built-in
Categorystrings listed in the Table below.- They will be automatically localized to the program's language.
- You can also use your own custom
Categorynames.- We strongly recommend doing this when you want to upload this node to the workshop.
- And using the plugin name as the
Categoryallows users to more clearly know that the node they are using is from a plugin, and which plugin is the node from.
Table The built-in Category strings and their localized text.
Category | en | zh_CN | ja |
|---|---|---|---|
CATEGORY_ACCESSORIES | Accessories | 配件 | 付属品 |
CATEGORY_ANIMATION | Animation | 动画 | アニメーション |
CATEGORY_ARITHMETIC | Arithmetic | 运算 | 計算 |
CATEGORY_ASSETS | Asset | 资源 | アセット |
CATEGORY_BLENDSHAPES | BlendShapes | BlendShape | BlendShape |
CATEGORY_CHARACTERS | Characters | 角色 | キャラクター |
CATEGORY_CINEMATOGRAPHY | Cinematography | 摄影 | 撮影 |
CATEGORY_CONDITIONALS | Conditionals | 条件 | 条件 |
CATEGORY_CONTROL_FLOW | Flow Control | 流控制 | フローコントロール |
CATEGORY_DATA | Data | 数据 | データ |
CATEGORY_DEBUG | Debug | 调试 | デバッグ |
CATEGORY_ENVIRONMENTS | Environment | 环境 | 環境 |
CATEGORY_EVENTS | Events | 事件 | イベント |
CATEGORY_EXTERNAL_INTEGRATION | External Integration | 外部集成 | 外部統合 |
CATEGORY_GRAPHS | Blueprints | 蓝图 | ブループリント |
CATEGORY_INPUT | Input | 输入 | – |
CATEGORY_LIGHTS | Lights | 光源 | ライト |
CATEGORY_LITERALS | Literals | 字面量 | リテラル |
CATEGORY_MOTION_CAPTURE | Motion Capture | 动作捕捉 | モーションキャプチャー |
CATEGORY_PROP | Props |