Class EntityExtensions
Extensions for Entity
public static class EntityExtensions
- Inheritance
-
EntityExtensions
Methods
Clone(Entity)
Deep clone of this entity.
public static Entity Clone(this Entity entity)
Parameters
entity
EntityThe entity to clone
Returns
- Entity
The cloned entity
EnableAll(Entity, bool, bool)
Enables or disables all ActivableEntityComponent.
public static void EnableAll(this Entity entity, bool enabled = true, bool applyOnChildren = false)
Parameters
entity
EntityThe entity to apply this method.
enabled
boolIf set to
true
, all ActivableEntityComponent will be enabled; otherwise they will be disabledapplyOnChildren
boolRecursively apply this method to the children of this entity
Enable<T>(Entity, bool, bool)
Enables or disables components of the specified type.
public static void Enable<T>(this Entity entity, bool enabled = true, bool applyOnChildren = false) where T : ActivableEntityComponent
Parameters
entity
EntityThe entity to apply this method.
enabled
boolIf set to
true
, all components of {T} will be enabled; otherwise they will be disabledapplyOnChildren
boolRecursively apply this method to the children of this entity
Type Parameters
T
Type of the component
GetChildren(Entity)
Gets the children of this entity.
public static IEnumerable<Entity> GetChildren(this Entity entity)
Parameters
entity
EntityThe entity
Returns
- IEnumerable<Entity>
An iteration on the child entity