docs.unity3d.com
Search Results for

    Show / Hide Table of Contents

    Method WithAnyChunkComponentRW

    WithAnyChunkComponentRW<T>()

    Add an optional chunk component type to the query.

    Declaration
    public EntityQueryBuilder WithAnyChunkComponentRW<T>()
    Returns
    Type Description
    EntityQueryBuilder

    The builder object that invoked this method.

    Type Parameters
    Name Description
    T

    Component type to use as an optional, read-write chunk component

    Remarks

    To match the resulting query, an Entity must have at least one of the query's optional component types, specified using either WithAny(ComponentType*, int) or WithAnyChunkComponent<T>(). Chunk components are a distinct component type, which are different from adding the same type as a standard component.

    Compare this to WithAllChunkComponent<T>()

    To add additional optional Chunk Components, call this method multiple times.

    To add component types that are not known at compile time, use WithAny<T>(ref T)

    The query will request read-only access to the referenced component(s). To request read/write access, use Unity.Entities.EntityQueryBuilder.WithAnyChunkComponentRW``1(``0@)

    In This Article
    Back to top
    Copyright © 2025 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)