Click or drag to resize
EntityManagerGetComponentT Method (Int32)
Gets a component of the passed type attached to the entity with the specified id.

Namespace: Slash.ECS.Components
Assembly: Slash.ECS (in Slash.ECS.dll) Version: 1.0.6018.40178
Syntax
public T GetComponent<T>(
	int entityId
)
where T : IEntityComponent

Parameters

entityId
Type: SystemInt32
Id of the entity to get the component of.

Type Parameters

T
Type of the component to get.

Return Value

Type: T
The component, if there is one of the specified type attached to the entity, and null otherwise.
Exceptions
ExceptionCondition
ArgumentOutOfRangeExceptionEntity id is negative.
ArgumentOutOfRangeExceptionEntity id has not yet been assigned.
ArgumentExceptionEntity with the specified id has already been removed.
ArgumentNullExceptionPassed component type is null.
ArgumentExceptionA component of the passed type has never been added before.
See Also