AddComponent
Adds a component to an entity.
読み終わるまでの所要時間 1 分最終更新 2日前
Definition
- Type: Method
- Namespace: Unity.Entities
- Assembly: UnityEngine.EntitiesModule
AddComponent<T>(Entity)
Adds a component to an entity.
public static bool AddComponent<T>(Entity entity)
Parameters
The entity.
Returns
Type | Description |
|---|---|
| bool | False if the entity already had the component. |
Remarks
This is a structural change.
AddComponent(Entity, ComponentType)
Adds a component to an entity.
public static bool AddComponent(Entity entity, ComponentType componentType)
Parameters
Returns
Type | Description |
|---|---|
| bool | False if the entity already had the component. |
Remarks
This is a structural change.
AddComponent(Entity, ComponentTypeSet)
Adds components to an entity.
public static void AddComponent(Entity entity, in ComponentTypeSet types)
Parameters
Remarks
This is one structural change, however many types the set holds. Types the entity already has are skipped.