Function FollowerEntityProxy.ToggleComponent

ToggleComponent<T> (World world, Entity entity, bool enabled, bool throwIfMissing)

Adds or removes a component from an entity.

Internal Static
void ToggleComponent<T> (

World

world

The ECS world containing the entity.

Entity

entity

The entity to modify.

bool

enabled

If true, adds the component. If false, removes it.

bool

throwIfMissing

If true, throws an InvalidOperationException if the entity does not exist. If false, silently returns.

)

Adds or removes a component from an entity.