Documentation

Unity Engine


Unity Engine


WithSharedComponentFilter

Only select chunks that have a specified value for a shared component.
Read time 1 minuteLast updated a day ago

Definition

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

WithSharedComponentFilter<T>(T)

Only select chunks that have a specified value for a shared component.
public QueryEnumerable<T1, T2> WithSharedComponentFilter<TSharedComponent1>(TSharedComponent1 sharedComponent) where TSharedComponent1 : unmanaged, ISharedComponentData

Parameters

sharedComponent

T
The value of
TSharedComponent1
which an entity must have in order to match this query

Returns

Type

Description

QueryEnumerable<T, U>QueryEnumerable, which allows enumerating over all RefRO, RefRW, EnabledRefRO and EnabledRefRW components that match the constructed Query.

WithSharedComponentFilter<T, U>(T, T)

Only select chunks that have the specified values for two shared components.
public QueryEnumerable<T1, T2> WithSharedComponentFilter<TSharedComponent1, TSharedComponent2>(TSharedComponent1 sharedComponent1, TSharedComponent2 sharedComponent2) where TSharedComponent1 : unmanaged, ISharedComponentData where TSharedComponent2 : unmanaged, ISharedComponentData

Parameters

sharedComponent1

T
The value of
TSharedComponent1
which an entity must have in order to match this query

sharedComponent2

T
The value of
TSharedComponent2
which an entity must have in order to match this query

Returns

Type

Description

QueryEnumerable<T, U>QueryEnumerable, which allows enumerating over all RefRO, RefRW, EnabledRefRO and EnabledRefRW components that match the constructed Query.