docs.unity.cn
    Show / Hide Table of Contents

    Method WithAnyRW

    WithAnyRW<T1>()

    Add optional component types to the query with ReadWrite mode.

    Declaration
    [GenerateTestsForBurstCompatibility(GenericTypeArguments = new Type[]{typeof(BurstCompatibleComponentData)})]
    public EntityQueryBuilder WithAnyRW<T1>()
    Returns
    Type Description
    EntityQueryBuilder

    The builder object that invoked this method.

    Type Parameters
    Name Description
    T1

    An optional ReadWrite component type

    Remarks

    If a query uses the FilterWriteGroup option, you must use WithAnyRW to specify the query's writeable optional components. Refer to the write groups guide for more information.

    WithAny<T1>() assumes the component type is read-only. To match the resulting query, an Entity must have all of the query's optional component types. WithAnyRW accepts up to two type arguments. You can add more component types by chaining calls together. In the following example, an Entity must have either a Scale, NonUniformScale, and/or CompositeScale component in order to match the query:
    To request read-only access, use WithAny<T>(ref T)

    WithAnyRW<T1, T2>()

    Add optional component types to the query with ReadWrite mode.

    Declaration
    [GenerateTestsForBurstCompatibility(GenericTypeArguments = new Type[]{typeof(BurstCompatibleComponentData), typeof(BurstCompatibleComponentData)})]
    public EntityQueryBuilder WithAnyRW<T1, T2>()
    Returns
    Type Description
    EntityQueryBuilder

    The builder object that invoked this method.

    Type Parameters
    Name Description
    T1
    T2

    An optional ReadWrite component type

    Remarks

    If a query uses the FilterWriteGroup option, you must use WithAnyRW to specify the query's writeable optional components. Refer to the write groups guide for more information.

    WithAny<T1>() assumes the component type is read-only. To match the resulting query, an Entity must have all of the query's optional component types. WithAnyRW accepts up to two type arguments. You can add more component types by chaining calls together. In the following example, an Entity must have either a Scale, NonUniformScale, and/or CompositeScale component in order to match the query:
    To request read-only access, use WithAny<T>(ref T)
    Back to top Copyright © 2023 Unity Technologies — Terms of use
    Generated by DocFX
    on Wednesday, September 20, 2023