Method HasChunkComponent
HasChunkComponent<T>(ref ComponentTypeHandle<T>)
Reports whether this chunk contains a chunk component of the specified component type.
Declaration
public readonly bool HasChunkComponent<T>(ref ComponentTypeHandle<T> typeHandle)
where T : struct, IComponentData
Parameters
Type | Name | Description |
---|---|---|
ComponentTypeHandle<T> | typeHandle | An object containing type and job safety information. To create this object, call GetComponentTypeHandle<T>(Boolean). Pass the object to a job using a public field you define as part of the job struct. |
Returns
Type | Description |
---|---|
Boolean | True, if this chunk contains a chunk component of the specified type. |
Type Parameters
Name | Description |
---|---|
T | The data type of the chunk component. |
Remarks
When an EntityQuery includes optional components used as chunk components (with WithAny<T1>()), some chunks returned by the query may have these chunk components and some may not. Use this function to determine whether or not the current chunk contains one of these optional component types as a chunk component.
See Also
HasChunkComponent<T>(ComponentTypeHandle<T>)
Obsolete. Use HasChunkComponent<T>(ref ComponentTypeHandle<T>) instead.
Declaration
[Obsolete("The typeHandle argument should now be passed by ref. (RemovedAfter Entities 1.0)", false)]
public readonly bool HasChunkComponent<T>(ComponentTypeHandle<T> typeHandle)
where T : struct, IComponentData
Parameters
Type | Name | Description |
---|---|---|
ComponentTypeHandle<T> | typeHandle | An object containing type and job safety information. To create this object, call GetComponentTypeHandle<T>(Boolean). Pass the object to a job using a public field you define as part of the job struct. |
Returns
Type | Description |
---|---|
Boolean | True, if this chunk contains a chunk component of the specified type. |
Type Parameters
Name | Description |
---|---|
T | The data type of the chunk component. |
HasChunkComponent<T>()
Reports whether this chunk contains a chunk component of the specified component type.
Declaration
public readonly bool HasChunkComponent<T>()
where T : struct, IComponentData
Returns
Type | Description |
---|---|
Boolean | True, if this chunk contains a chunk component of the specified type. |
Type Parameters
Name | Description |
---|---|
T | The data type of the chunk component. |
Remarks
When an EntityQuery includes optional components used as chunk components (with WithAny<T1>()), some chunks returned by the query may have these chunk components and some may not. Use this function to determine whether or not the current chunk contains one of these optional component types as a chunk component.