AddComponent
Adds a component to an entity.
阅读时间1 分钟最后更新于 1 天前
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.