Identity Node
This guide will walk you through creating identity nodes in Jungle manually. Let's get started!
Step 1: Create a New C# Script
First, create a new C# script in your Unity project.
Step 2: Inherit from IdentityNode
Next, make your new class inherit from the IdentityNode class.
This will form the foundation of your identity node.
using Jungle;
public class MyIdentityNode : IdentityNode
{
}
Step 3: Implement OnStart and OnUpdate
Now, you need to implement the OnStart and OnUpdate methods.
using Jungle;
public class MyIdentityNode : IdentityNode
{
protected override void OnStart()
{
}
protected override void OnUpdate()
{
}
}
Step 4: Add the IdentityNode Attribute
Add the IdentityNode attribute to your class.
This defines the input and output ports.
If you don't want an output port, set the OutputPortName property to null (OutputPortName = null).
using Jungle;
[IdentityNode(
InputPortName = "My Input",
OutputPortName = "My Output"
)]
public class MyIdentityNode : IdentityNode
{
protected override void OnStart()
{
}
protected override void OnUpdate()
{
}
}
Step 5: Add the NodeProperties Attribute
Finally, add the NodeProperties attribute to your class.
This defines additional properties such as the title, description, and category of your node.
using Jungle;
[NodeProperties(
Title = "My Identity Node",
Description = "This is an identity node.",
Category = "My Nodes/Identity",
Color = Green
)]
[IdentityNode(
InputPortName = "My Input",
OutputPortName = "My Output"
)]
public class MyIdentityNode : IdentityNode
{
protected override void OnStart()
{
}
protected override void OnUpdate()
{
}
}
With these steps, you've created a basic identity node in Jungle. Feel free to customize the input and output properties to suit your needs!