Documentation

Unity Engine


Unity Engine


RequireAnyForUpdate

Provide a set of queries, one of which must match entities for the system to run.
Read time 2 minutesLast updated a day ago

Definition

  • Type: Method
  • Namespace: Unity.Entities
  • Assembly: UnityEngine.EntitiesModule

RequireAnyForUpdate(EntityQuery[])

Provide a set of queries, one of which must match entities for the system to run.
public void RequireAnyForUpdate(params EntityQuery[] queries)

Parameters

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

Remarks

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.

RequireAnyForUpdate(NativeArray<EntityQuery>)

Provide a set of queries, one of which must match entities for the system to run.
public void RequireAnyForUpdate(NativeArray<EntityQuery> queries)

Parameters

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

Remarks

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.