docs.unity3d.com
Search Results for

    Show / Hide Table of Contents

    Method RequireAnyForUpdate

    RequireAnyForUpdate(params EntityQuery[])

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

    Declaration
    public void RequireAnyForUpdate(params EntityQuery[] queries)
    Parameters
    Type Name Description
    EntityQuery[] queries

    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.

    See Also
    ShouldRunSystem()
    RequireMatchingQueriesForUpdateAttribute

    RequireAnyForUpdate(NativeArray<EntityQuery>)

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

    Declaration
    public void RequireAnyForUpdate(NativeArray<EntityQuery> queries)
    Parameters
    Type Name Description
    NativeArray<EntityQuery> queries

    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.

    See Also
    ShouldRunSystem()
    RequireMatchingQueriesForUpdateAttribute
    In This Article
    Back to top
    Copyright © 2024 Unity Technologies — Trademarks and terms of use
    • Legal
    • Privacy Policy
    • Cookie Policy
    • Do Not Sell or Share My Personal Information
    • Your Privacy Choices (Cookie Settings)