 | EntityManagerAddComponentT Method (Int32) |
Attaches a new component of the passed type to the entity with the specified id.
Namespace: Slash.ECS.ComponentsAssembly: Slash.ECS (in Slash.ECS.dll) Version: 1.0.6018.40178
Syntaxpublic T AddComponent<T>(
int entityId
)
where T : new(), IEntityComponent
Public Function AddComponent(Of T As {New, IEntityComponent}) (
entityId As Integer
) As T
public:
generic<typename T>
where T : gcnew(), IEntityComponent
T AddComponent(
int entityId
)
member AddComponent :
entityId : int -> 'T when 'T : new() and IEntityComponent
Parameters
- entityId
- Type: SystemInt32
Id of the entity to attach the component to.
Type Parameters
- T
- Type of the component to add.
Return Value
Type:
TAttached component.
See Also