AddComponentData
Adds the ComponentData T, an IComponentData, to this GameObject.
Read time 1 minuteLast updated 6 hours ago
Definition
- Type: Method
- Namespace: UnityEngine
- Assembly: UnityEngine.CoreModule
AddComponentData<T>()
Adds the ComponentData , an , to this GameObject.
TIComponentDatapublic bool AddComponentData<T>() where T : unmanaged, IComponentData
Returns
Type | Description |
|---|---|
| bool | False if the GameObject already had the ComponentData. Its value is then only set if you pass |
Remarks
Throws an if the GameObject has been destroyed.
ArgumentExceptionThis is a structural change: it waits for all jobs in the World to complete. To make it from a job or a system without waiting, record it in a instead.
Unity.Entities.EntityCommandBufferAddComponentData<T>(T)
Adds the ComponentData , an , to this GameObject.
TIComponentDatapublic bool AddComponentData<T>(T componentData) where T : unmanaged, IComponentData
Parameters
Returns
Type | Description |
|---|---|
| bool | False if the GameObject already had the ComponentData. Its value is then only set if you pass |
Remarks
Throws an if the GameObject has been destroyed.
ArgumentExceptionThis is a structural change: it waits for all jobs in the World to complete. To make it from a job or a system without waiting, record it in a instead.
Unity.Entities.EntityCommandBuffer