Method GetComponentData
GetComponentData<T>(Entity)
Gets the value of a component for an entity.
Declaration
public T GetComponentData<T>(Entity entity) where T : unmanaged, IComponentData
Parameters
Type | Name | Description |
---|---|---|
Entity | entity | The entity. |
Returns
Type | Description |
---|---|
T | A struct of type T containing the component value. |
Type Parameters
Name | Description |
---|---|
T | The type of component to retrieve. |
Exceptions
Type | Condition |
---|---|
ArgumentException | Thrown if the component type has no fields. |
GetComponentData<T>(SystemHandle)
Gets the value of a component for an entity associated with a system.
Declaration
public T GetComponentData<T>(SystemHandle system) where T : unmanaged, IComponentData
Parameters
Type | Name | Description |
---|---|---|
SystemHandle | system | The system handle. |
Returns
Type | Description |
---|---|
T | A struct of type T containing the component value. |
Type Parameters
Name | Description |
---|---|
T | The type of component to retrieve. |
Exceptions
Type | Condition |
---|---|
ArgumentException | Thrown if the component type has no fields. |
InvalidOperationException | Thrown if the system isn't from thie world. |