Documentation

Unity Engine

Unity Engine

SetSharedComponentFilter

Filters this EntityQuery so that it only selects entities with shared component of type SharedComponent equal to sharedComponent.
Read time 1 minuteLast updated 4 days ago

Definition

  • Type: Method
  • Namespace: Unity.Entities
  • Assembly: UnityEngine.EntitiesModule

SetSharedComponentFilter<T>(T)

Filters this EntityQuery so that it only selects entities with shared component of type
SharedComponent
equal to
sharedComponent
.
public void SetSharedComponentFilter<SharedComponent>(SharedComponent sharedComponent) where SharedComponent : unmanaged, ISharedComponentData

Parameters

sharedComponent

T
The shared component value to filter.

Remarks

This call disables any existing chunk filtering on this query. For additive filtering, use EntityQuery.AddSharedComponentFilter.

SetSharedComponentFilter<T, U>(T, T)

Filters this EntityQuery based on the values of two separate unmanaged shared components.
public void SetSharedComponentFilter<SharedComponent1, SharedComponent2>(SharedComponent1 sharedComponent1, SharedComponent2 sharedComponent2) where SharedComponent1 : unmanaged, ISharedComponentData where SharedComponent2 : unmanaged, ISharedComponentData

Parameters

sharedComponent1

T
Shared component value to filter.

sharedComponent2

T
Shared component value to filter.

Remarks

The filter only selects entities which have both a shared component of type
SharedComponent1
whose value equals
sharedComponent1
and a shared component of type
SharedComponent2
whose value equals
sharedComponent2
. This call disables any existing chunk filtering on this query. For additive filtering, use EntityQuery.AddSharedComponentFilter.