docs.unity3d.com
Search Results for

    Show / Hide Table of Contents

    Method WithAnyRW

    WithAnyRW<T1>()

    Add optional component types to the query with ReadWrite mode.

    Declaration
    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
    public EntityQueryBuilder WithAnyRW<T1, T2>()
    Returns
    Type Description
    EntityQueryBuilder

    The builder object that invoked this method.

    Type Parameters
    Name Description
    T1

    An optional ReadWrite component type

    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)

    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)