docs.unity3d.com
    Show / Hide Table of Contents

    Method CompareComponents

    CompareComponents(ComponentType[])

    Compares a list of component types to the types defining this EntityQuery.

    Declaration
    [NotBurstCompatible]
    public bool CompareComponents(ComponentType[] componentTypes)
    Parameters
    Type Name Description
    ComponentType[] componentTypes

    An array of ComponentType objects.

    Returns
    Type Description
    Boolean

    True, if the list of types, including any read/write access specifiers, matches the list of required component types of this EntityQuery.

    Remarks

    Only required types in the query are used as the basis for the comparison. If you include types that the query excludes or only includes as optional, the comparison returns false.

    CompareComponents(NativeArray<ComponentType>)

    Compares a list of component types to the types defining this EntityQuery.

    Declaration
    public bool CompareComponents(NativeArray<ComponentType> componentTypes)
    Parameters
    Type Name Description
    NativeArray<ComponentType> componentTypes

    An array of ComponentType objects.

    Returns
    Type Description
    Boolean

    True, if the list of types, including any read/write access specifiers, matches the list of required component types of this EntityQuery.

    Remarks

    Only required types in the query are used as the basis for the comparison. If you include types that the query excludes or only includes as optional, the comparison returns false. Do not include the Entity type, which is included implicitly.

    Back to top
    Terms of use
    Copyright © 2023 Unity Technologies — Terms of use
    • Legal
    • Privacy Policy
    • Cookies
    • Do Not Sell or Share My Personal Information
    • Your Privacy Choices (Cookie Settings)
    "Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
    Generated by DocFX on 18 October 2023