Entity.InsertChild(int,Entity).md
July 22, 2024 ยท View on GitHub
Friflo.Engine.ECS
Friflo.Engine.ECS.Entity
Entity.InsertChild(int, Entity) Method
Insert the given entity as a child to this entity at the passed index.
public void InsertChild(int index, Friflo.Engine.ECS.Entity entity);
Parameters
index System.Int32
entity Entity
Remarks
Executes in O(1) in case the child has no paren and index == ChildCount.
Otherwise, O(N). N = ChildCount - index
The subtree structure of the added entity remains unchanged.
To iterate all entities with child entities use TreeNode in a Query().