Making a custom node in C# is as easy as writing a static method with a special [ActionGraphNode( id )] attribute. You should also add [Pure] if you want your node to be an expression node - a node without signals.

/// <summary>
/// Increments the value by 1.
/// </summary>
[ActionGraphNode( "example.addone" ), Pure]
[Title( "Add One" ), Group( "Examples" ), Icon( "exposure_plus_1" )]
public static int AddOne( int value )
{
	return value + 1;
}

/// <summary>
/// Waits for one second.
/// </summary>
[ActionGraphNode( "example.waitone" )]
[Title( "Wait One" ), Group( "Examples" ), Icon( "hourglass_bottom" )]
public static async Task WaitOne()
{
	await Task.Delay( TimeSpan.FromSeconds( 1d ) );
}

Our custom "Add One" and "Wait One" nodes in the ActionGraph editor.






Created 23 Jan 2024
Updated 9 Oct 2024