 | EntityManagerTryGetComponent Method (Int32, Type, IEntityComponent) |
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(
int entityId,
Type componentType,
out IEntityComponent entityComponent
)
Public Function TryGetComponent (
entityId As Integer,
componentType As Type,
<OutAttribute> ByRef entityComponent As IEntityComponent
) As Boolean
public:
bool TryGetComponent(
int entityId,
Type^ componentType,
[OutAttribute] IEntityComponent^% entityComponent
)
member TryGetComponent :
entityId : int *
componentType : Type *
entityComponent : IEntityComponent byref -> bool
Parameters
- entityId
- Type: SystemInt32
Id of the entity to get the component of. - componentType
- Type: SystemType
Type of the component to get. - entityComponent
- Type: Slash.ECS.ComponentsIEntityComponent
Retrieved entity component, or null, if no component could be found.
Return Value
Type:
Booleantrue, if a component could be found, and
false otherwise.
See Also