Class WithTraitTypesExtension
Helper extensions to instantiate WithTraitTypesFilter
Namespace: Unity.Semantic.Traits.Queries
Syntax
public static class WithTraitTypesExtension
Methods
WithTraitTypes(TraitQuery, ComponentType[])
Extension method to create a WithTraitTypesFilter with an array of Trait types
Declaration
public static TraitQuery WithTraitTypes(this TraitQuery traitQuery, params ComponentType[] traitTypes)
Parameters
| Type | Name | Description |
|---|---|---|
| TraitQuery | traitQuery | Query object |
| ComponentType[] | traitTypes | Array of Trait types |
Returns
| Type | Description |
|---|---|
| TraitQuery | Updated query object with the filter added |
WithTraitTypes<T>(TraitQuery)
Extension method to create a WithTraitTypesFilter with one Trait type
Declaration
public static TraitQuery WithTraitTypes<T>(this TraitQuery traitQuery)
where T : ITraitData
Parameters
| Type | Name | Description |
|---|---|---|
| TraitQuery | traitQuery | Query object |
Returns
| Type | Description |
|---|---|
| TraitQuery | Updated query object with the filter added |
Type Parameters
| Name | Description |
|---|---|
| T | Trait type |
WithTraitTypes<T1, T2>(TraitQuery)
Extension method to create a WithTraitTypesFilter with two Trait types
Declaration
public static TraitQuery WithTraitTypes<T1, T2>(this TraitQuery traitQuery)
where T1 : ITraitData where T2 : ITraitData
Parameters
| Type | Name | Description |
|---|---|---|
| TraitQuery | traitQuery | Query object |
Returns
| Type | Description |
|---|---|
| TraitQuery | Updated query object with the filter added |
Type Parameters
| Name | Description |
|---|---|
| T1 | Trait type |
| T2 | Trait type |
WithTraitTypes<T1, T2, T3>(TraitQuery)
Extension method to create a WithTraitTypesFilter with three Trait types
Declaration
public static TraitQuery WithTraitTypes<T1, T2, T3>(this TraitQuery traitQuery)
where T1 : ITraitData where T2 : ITraitData where T3 : ITraitData
Parameters
| Type | Name | Description |
|---|---|---|
| TraitQuery | traitQuery | Query object |
Returns
| Type | Description |
|---|---|
| TraitQuery | Updated query object with the filter added |
Type Parameters
| Name | Description |
|---|---|
| T1 | Trait type |
| T2 | Trait type |
| T3 | Trait type |