docs.unity3d.com
Search Results for

    Show / Hide Table of Contents

    Method SetSharedComponentFilterManaged

    SetSharedComponentFilterManaged<SharedComponent>(SharedComponent)

    Filters this EntityQuery so that it only selects entities with a shared component of type SharedComponent equal to sharedComponent.

    Declaration
    [ExcludeFromBurstCompatTesting("Uses managed objects")]
    public void SetSharedComponentFilterManaged<SharedComponent>(SharedComponent sharedComponent) where SharedComponent : struct, ISharedComponentData
    Parameters
    Type Name Description
    SharedComponent sharedComponent

    The shared component value to filter.

    Type Parameters
    Name Description
    SharedComponent

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

    Remarks

    This call disables any existing chunk filtering on this query. For additive filtering, use AddSharedComponentFilterManaged<SharedComponent>(SharedComponent).

    SetSharedComponentFilterManaged<SharedComponent1, SharedComponent2>(SharedComponent1, SharedComponent2)

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

    Declaration
    [ExcludeFromBurstCompatTesting("Contains managed shared component code path")]
    public void SetSharedComponentFilterManaged<SharedComponent1, SharedComponent2>(SharedComponent1 sharedComponent1, SharedComponent2 sharedComponent2) where SharedComponent1 : struct, ISharedComponentData where SharedComponent2 : struct, ISharedComponentData
    Parameters
    Type Name Description
    SharedComponent1 sharedComponent1

    Shared component value to filter.

    SharedComponent2 sharedComponent2

    Shared component value to filter.

    Type Parameters
    Name Description
    SharedComponent1

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

    SharedComponent2

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

    Remarks

    The filter only selects entities which have both a shared component of type SharedComponent1 whose value equals sharedComponent1 and a shared component of type SharedComponent2 whose value equals sharedComponent2. This call disables any existing chunk filtering on this query. For additive filtering, use AddSharedComponentFilterManaged<SharedComponent>(SharedComponent).

    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)