Method WithPresentRW
WithPresentRW<T1>()
Add required component types to the query with ReadWrite mode, whether they are enabled or disabled.
Declaration
[GenerateTestsForBurstCompatibility(GenericTypeArguments = new Type[] { typeof(BurstCompatibleComponentData) })]
public EntityQueryBuilder WithPresentRW<T1>()
Returns
Type | Description |
---|---|
Entity |
The builder object that invoked this method. |
Type Parameters
Name | Description |
---|---|
T1 | A required ReadWrite component type |
Remarks
If a query uses the Filter
To match the resulting query, an Entity must have all of the query's required component types, regardless of
whether they are enabled or disabled.
To match required types only if they're enabled, use With
WithPresentRW accepts up to two type arguments. You can add more component types by chaining calls together.
var query = new EntityQueryBuilder(Allocator.Temp)
.WithAll<Friction>()
.WithAllRW<ObjectPosition, ObjectVelocity>()
.WithAllRW<ObjectRotation, ObjectRotationSpeed>()
.Build(this);
To request read-only access to the reference component(s), use With
WithPresentRW<T1, T2>()
Add required component types to the query with ReadWrite mode, whether they are enabled or disabled.
Declaration
[GenerateTestsForBurstCompatibility(GenericTypeArguments = new Type[] { typeof(BurstCompatibleComponentData), typeof(BurstCompatibleComponentData) })]
public EntityQueryBuilder WithPresentRW<T1, T2>()
Returns
Type | Description |
---|---|
Entity |
The builder object that invoked this method. |
Type Parameters
Name | Description |
---|---|
T1 | A required ReadWrite component type |
T2 | A required ReadWrite component type |
Remarks
If a query uses the Filter
To match the resulting query, an Entity must have all of the query's required component types, regardless of
whether they are enabled or disabled.
To match required types only if they're enabled, use With
WithPresentRW accepts up to two type arguments. You can add more component types by chaining calls together.
var query = new EntityQueryBuilder(Allocator.Temp)
.WithAll<Friction>()
.WithAllRW<ObjectPosition, ObjectVelocity>()
.WithAllRW<ObjectRotation, ObjectRotationSpeed>()
.Build(this);
To request read-only access to the reference component(s), use With