TreeNode.md
July 22, 2024 ยท View on GitHub
Friflo.Engine.ECS
Friflo.Engine.ECS
TreeNode Struct
A TreeNode component stores the ChildEntities of an Entity.
It is used to build up an entity hierarchy used for scene graphs.
public struct TreeNode :
Friflo.Engine.ECS.IComponent
Implements IComponent
Remarks
To change the ChildEntities of an Entity use:
- AddChild(Entity)
- RemoveChild(Entity)
- InsertChild(int, Entity)
Internally the child entities of an entity are stored in up to a dozen int[] arrays.
If these array buffers grown large enough over time no heap allocations will happen if adding or removing child entities.
| Properties | |
|---|---|
| ChildCount | Returns the number of ChildEntities. |
| ChildIds | Property is obsolete. Use GetChildIds(EntityStore) instead. |
| Methods | |
|---|---|
| GetChildEntities(EntityStore) | Returns the child entities. Executes in O(1). |
| GetChildIds(EntityStore) | Returns the child entity ids. Executes in O(1). |
| ToString() |