docs.unity.cn
    Show / Hide Table of Contents

    Method RequireAnyForUpdate

    RequireAnyForUpdate(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
    Back to top Copyright © 2023 Unity Technologies — Terms of use
    Generated by DocFX
    on Wednesday, June 21, 2023