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

SystemState.RequireAnyForUpdate

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 void RequireAnyForUpdate(params EntityQuery[] queries);

Parameters

Parameter Description
queries A set of queries, one of which must match entities this frame in order for this system to run.

Description

Provide a set of queries, one of which must match entities for the system to run.

This method can only be called from a system's OnCreate method.

You can call this method multiple times from the same system to add multiple sets of required queries. Each set must have at least one query that matches an entity for the system to run.

Any queries added through RequireAnyForUpdate and [RequireForUpdate] override all other queries created by this system for the purposes of deciding whether to update. In other words, if any set of required queries does not find matching entities, the update is skipped even if another query created for the system (either explicitly or implicitly) does match entities and vice versa.

[EntityQueries]: xref:Unity.Entities.EntityQuery [enableable components]: xref:T:Unity.Entities.IEnableableComponent

Additional resources: SystemState.ShouldRunSystem, RequireMatchingQueriesForUpdateAttribute


Declaration

public void RequireAnyForUpdate(NativeArray<EntityQuery> queries);

Parameters

Parameter Description
queries A set of queries, one of which must match entities this frame in order for this system to run.

Description

Provide a set of queries, one of which must match entities for the system to run.

This method can only be called from a system's OnCreate method.

You can call this method multiple times from the same system to add multiple sets of required queries. Each set must have at least one query that matches an entity for the system to run.

Any queries added through RequireAnyForUpdate and [RequireForUpdate] override all other queries created by this system for the purposes of deciding whether to update. In other words, if any set of required queries does not find matching entities, the update is skipped even if another query created for the system (either explicitly or implicitly) does match entities and vice versa.

[EntityQueries]: xref:Unity.Entities.EntityQuery [enableable components]: xref:T:Unity.Entities.IEnableableComponent

Additional resources: SystemState.ShouldRunSystem, RequireMatchingQueriesForUpdateAttribute