docs.unity3d.com
    Show / Hide Table of Contents

    Method SetSharedComponentFilter

    SetSharedComponentFilter<SharedComponent1>(SharedComponent1)

    Filters this EntityQuery so that it only selects entities with shared component values matching the values specified by the sharedComponent1 parameter.

    Declaration
    public void SetSharedComponentFilter<SharedComponent1>(SharedComponent1 sharedComponent1)
        where SharedComponent1 : struct, ISharedComponentData
    Parameters
    Type Name Description
    SharedComponent1 sharedComponent1

    The shared component values on which to filter.

    Type Parameters
    Name Description
    SharedComponent1

    The type of shared component. (The type must also be one of the types used to create the EntityQuery.

    SetSharedComponentFilter<SharedComponent1, SharedComponent2>(SharedComponent1, SharedComponent2)

    Filters this EntityQuery based on the values of two separate shared components.

    Declaration
    public void SetSharedComponentFilter<SharedComponent1, SharedComponent2>(SharedComponent1 sharedComponent1, SharedComponent2 sharedComponent2)
        where SharedComponent1 : struct, ISharedComponentData where SharedComponent2 : struct, ISharedComponentData
    Parameters
    Type Name Description
    SharedComponent1 sharedComponent1

    Shared component values on which to filter.

    SharedComponent2 sharedComponent2

    Shared component values on which to filter.

    Type Parameters
    Name Description
    SharedComponent1

    The type of shared component. (The type must also be one of the types used to create the EntityQuery.

    SharedComponent2

    The type of shared component. (The type must also be one of the types used to create the EntityQuery.

    Remarks

    The filter only selects entities for which both shared component values specified by the sharedComponent1 and sharedComponent2 parameters match.

    In This Article
    • SetSharedComponentFilter<SharedComponent1>(SharedComponent1)
    • SetSharedComponentFilter<SharedComponent1, SharedComponent2>(SharedComponent1, SharedComponent2)
    Back to top
    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