docs.unity.cn
    Show / Hide Table of Contents

    Method WithSharedComponentFilter

    WithSharedComponentFilter<TSharedComponent1>(TSharedComponent1)

    Only select chunks that have a specified value for a shared component.

    Declaration
    public readonly QueryEnumerableWithEntity<T1> WithSharedComponentFilter<TSharedComponent1>(TSharedComponent1 sharedComponent)
        where TSharedComponent1 : struct, ISharedComponentData
    Parameters
    Type Name Description
    TSharedComponent1 sharedComponent

    The value of TSharedComponent1 which an entity must have in order to match this query

    Returns
    Type Description
    QueryEnumerableWithEntity<T1>

    QueryEnumerableWithEntity, which allows enumerating over all Aspects, RefRO, RefRW, components, EnabledRefRO, EnabledRefRW and entities that match the constructed Query.

    Type Parameters
    Name Description
    TSharedComponent1

    The shared component type

    WithSharedComponentFilter<TSharedComponent1, TSharedComponent2>(TSharedComponent1, TSharedComponent2)

    Only select chunks that have a specified value for a shared component.

    Declaration
    public readonly QueryEnumerableWithEntity<T1> WithSharedComponentFilter<TSharedComponent1, TSharedComponent2>(TSharedComponent1 sharedComponent1, TSharedComponent2 sharedComponent2)
        where TSharedComponent1 : struct, ISharedComponentData where TSharedComponent2 : struct, ISharedComponentData
    Parameters
    Type Name Description
    TSharedComponent1 sharedComponent1

    The value of TSharedComponent1 which an entity must have in order to match this query

    TSharedComponent2 sharedComponent2

    The value of TSharedComponent2 which an entity must have in order to match this query

    Returns
    Type Description
    QueryEnumerableWithEntity<T1>

    QueryEnumerableWithEntity, which allows enumerating over all Aspects, RefRO, RefRW, components, EnabledRefRO, EnabledRefRW and entities that match the constructed Query.

    Type Parameters
    Name Description
    TSharedComponent1

    The first shared component type

    TSharedComponent2

    The second shared component type

    Back to top Copyright © 2023 Unity Technologies — Terms of use
    Generated by DocFX
    on Wednesday, June 21, 2023