Class WithTraitTypesExtension | Semantic Traits | 0.2.8-preview
docs.unity3d.com
    Show / Hide Table of Contents

    Class WithTraitTypesExtension

    Helper extensions to instantiate WithTraitTypesFilter

    Inheritance
    Object
    WithTraitTypesExtension
    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

    Back to top
    Copyright © 2023 Unity Technologies — Terms of use
    • Legal
    • Privacy Policy
    • Cookies
    • Do Not Sell or Share My Personal Information
    • Your Privacy Choices (Cookie Settings)
    "Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
    Generated by DocFX on 18 October 2023