Description
The AddChild
method allows you to add a child SceneObject
to the current SceneObject
. This establishes a parent-child relationship between the two objects, where the child object will inherit transformations and other properties from the parent.
Usage
To use the AddChild
method, you need to provide a name for the child object and the SceneObject
instance that you want to add as a child. The name is a string identifier for the child object within the parent.
Example
// Create a new SceneObject
SceneObject parentObject = new SceneObject();
SceneObject childObject = new SceneObject();
// Add the child object to the parent
parentObject.AddChild("ChildName", childObject);
// The childObject is now a child of parentObject and will inherit transformations from it.