 | EntityManagerTryGetComponentT Method (Int32, T) |
Tries to get a component of the passed type attached to the entity with the specified id.
Namespace: Slash.ECS.ComponentsAssembly: Slash.ECS (in Slash.ECS.dll) Version: 1.0.6018.40178
Syntaxpublic bool TryGetComponent<T>(
int entityId,
out T entityComponent
)
where T : IEntityComponent
Public Function TryGetComponent(Of T As IEntityComponent) (
entityId As Integer,
<OutAttribute> ByRef entityComponent As T
) As Boolean
public:
generic<typename T>
where T : IEntityComponent
bool TryGetComponent(
int entityId,
[OutAttribute] T% entityComponent
)
member TryGetComponent :
entityId : int *
entityComponent : 'T byref -> bool when 'T : IEntityComponent
Parameters
- entityId
- Type: SystemInt32
Id of the entity to get the component of. - entityComponent
- Type: T
Retrieved entity component, or null, if no component could be found.
Type Parameters
- T
- Type of the component to get.
Return Value
Type:
Booleantrue, if a component could be found, and
false otherwise.
See Also