Method WithAbsentChunkComponent
WithAbsentChunkComponent<T>()
Add an absent Chunk Component type to the query.
Declaration
public EntityQueryBuilder WithAbsentChunkComponent<T>()
Returns
Type | Description |
---|---|
EntityQueryBuilder | The builder object that invoked this method. |
Type Parameters
Name | Description |
---|---|
T | Component type to use as an absent 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)