EntityUtils.GetEntityComponent(Entity,ComponentType).md

February 25, 2024 ยท View on GitHub

Friflo.Engine.ECS

Friflo.Engine.ECS.EntityUtils

EntityUtils.GetEntityComponent(Entity, ComponentType) Method

Returns a copy of the entity component as an object.
The returned IComponent is a boxed struct.
So avoid using this method whenever possible. Use GetComponent<T>() instead.

public static Friflo.Engine.ECS.IComponent GetEntityComponent(Friflo.Engine.ECS.Entity entity, Friflo.Engine.ECS.ComponentType componentType);

Parameters

entity Entity

componentType ComponentType

Returns

IComponent