Version: Unity 7.0 Alpha (7000.0)
LanguageEnglish
  • C#

ArchetypeChunk.HasChunkComponent

Suggest a change

Success!

Thank you for helping us improve the quality of Unity Documentation. Although we cannot accept all submissions, we do read each suggested change from our users and will make updates where applicable.

Close

Submission failed

For some reason your suggested change could not be submitted. Please <a>try again</a> in a few minutes. And thank you for taking the time to help us improve the quality of Unity Documentation.

Close

Cancel

Declaration

public bool HasChunkComponent(ref ComponentTypeHandle`1 typeHandle);

Parameters

Parameter Description
typeHandle An object containing type and job safety information. To create this object, call ComponentSystemBase.GetComponentTypeHandle. Pass the object to a job using a public field you define as part of the job struct.

Returns

bool True, if this chunk contains a chunk component of the specified type.

Description

Reports whether this chunk contains a chunk component of the specified component type.

When an EntityQuery includes optional components used as chunk components (with EntityQueryBuilder.WithAny), 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.

Additional resources: ArchetypeChunk.Has


Declaration

public bool HasChunkComponent();

Returns

bool True, if this chunk contains a chunk component of the specified type.

Description

Reports whether this chunk contains a chunk component of the specified component type.

When an EntityQuery includes optional components used as chunk components (with EntityQueryBuilder.WithAny), 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.