docs.unity3d.com
Search Results for

    Show / Hide Table of Contents

    Method WithNoneChunkComponent

    WithNoneChunkComponent<T>()

    Add an excluded Chunk Component type to the query.

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

    The builder object that invoked this method.

    Type Parameters
    Name Description
    T

    Component type to use as an excluded Chunk Component

    Remarks

    Call this method on the query builder to exclude any entities that have the specified chunk component. Chunk components are a distinct component type, which are different from excluding the same type as a standard component.

    var entityWithPlayerComponent = EntityManager.CreateEntity();
    EntityManager.AddComponent<Player>(entityWithPlayerComponent);
    

    var entityWithPlayerChunkComponent = EntityManager.CreateEntity(); EntityManager.AddComponent(entityWithPlayerChunkComponent, ComponentType.ChunkComponent<Player>());

    // This query will only match entityWithPlayerChunkComponent, excluding entityWithPlayerComponent var noPlayerQuery = new EntityQueryBuilder(Allocator.Temp) .WithNone<Player>() .Build(this);

    // This query will only match entityWithPlayerComponent, excluding entityWithPlayerChunkComponent var noChunkPlayerQuery = new EntityQueryBuilder(Allocator.Temp) .WithNoneChunkComponent<Player>() .Build(this);

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

    To add component types that are not known at compile time, use WithNone<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)