 | EntityManagerGetComponent Method (Int32, Type, Boolean) |
Gets 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 IEntityComponent GetComponent(
int entityId,
Type componentType,
bool considerInherited = false
)
Public Function GetComponent (
entityId As Integer,
componentType As Type,
Optional considerInherited As Boolean = false
) As IEntityComponent
public:
IEntityComponent^ GetComponent(
int entityId,
Type^ componentType,
bool considerInherited = false
)
member GetComponent :
entityId : int *
componentType : Type *
?considerInherited : bool
(* Defaults:
let _considerInherited = defaultArg considerInherited false
*)
-> IEntityComponent
Parameters
- entityId
- Type: SystemInt32
Id of the entity to get the component of. - componentType
- Type: SystemType
Type of the component to get. - considerInherited (Optional)
- Type: SystemBoolean
Indicates if a component that was inherited by the specified type should be returned if
found.
Return Value
Type:
IEntityComponent The component, if there is one of the specified type attached to the entity, and null otherwise.
Exceptions
See Also