Class NodeExtensions
Namespace: DiceRolling.Helpers
Assembly: dice-rolling.dll
Provides extension methods for Godot Node operations
public static class NodeExtensions
Inheritance
Inherited Members
Show/Hide Inherited Members
Methods
FindAncestorOfType<T>(Node)
Searches upwards in the scene tree for the first ancestor of the specified type T.
public static T? FindAncestorOfType<T>(this Node node) where T : Node
Parameters
node
Node
The node to start searching upwards from.
Returns
T?
The first ancestor node of type T found, or null if none exists.
Type Parameters
T
The type of ancestor node to find.
FindNodeOfType<T>(Node)
Recursively searches downwards for a node of the specified type starting from the given root node.
public static T? FindNodeOfType<T>(this Node root) where T : class
Parameters
root
Node
The root node to start searching from
Returns
T?
The first node of type T found, or null if none exists
Type Parameters
T
The type of node to find