Method GetRequiredComponentDataPtrRW
GetRequiredComponentDataPtrRW<T>(ref ComponentTypeHandle<T>)
Provides an unsafe read/write interface to components stored in this chunk. This variant assumes that the component is present in the chunk; use GetComponentDataPtrRW<T>(ref ComponentTypeHandle<T>) in cases where the caller can't guarantee this.
Declaration
public readonly void* GetRequiredComponentDataPtrRW<T>(ref ComponentTypeHandle<T> typeHandle)
Parameters
Type | Name | Description |
---|---|---|
ComponentTypeHandle<T> | typeHandle | An object containing type and job safety information. To create this object, call GetComponentTypeHandle<T>(bool). Pass the object to a job using a public field you define as part of the job struct. |
Returns
Type | Description |
---|---|
void* | A pointer to the component data stored in the chunk. Returns null if the chunk's archetype does not include
component type |
Type Parameters
Name | Description |
---|---|
T | The data type of the component. |
Exceptions
Type | Condition |
---|---|
ArgumentException | If you call this function on a "tag" component type (which is an empty component with no fields). |
InvalidOperationException | If the provided type handle is read-only. |