Struct Binary.Trait | Kinematica | 0.5.0-preview.1
docs.unity3d.com
    Show / Hide Table of Contents

    Struct Binary.Trait

    Traits are user-defined characteristics that can be associated to tags or markers.

    Namespace: Unity.Kinematica
    Syntax
    public struct Trait
    Remarks

    Users can define own custom data by using C# structs. These structs will then show up in the Kinematica builder tool and allow tags or markers to be created carrying specific instances of the corresponding traits. A trait itself wraps the actual payload (the instance of the user-defined struct).

    [Trait]
    public struct Anchor
    {
        public AffineTransform transform;
    }

    Fields

    typeIndex

    Denotes the type index of this trait.

    Declaration
    public Binary.TypeIndex typeIndex
    Field Value
    Type Description
    Binary.TypeIndex

    Methods

    IsType(Binary.TypeIndex)

    Determines if the trait is equal to a type passed as argument.

    Declaration
    public bool IsType(Binary.TypeIndex typeIndex)
    Parameters
    Type Name Description
    Binary.TypeIndex typeIndex

    The type to compare the trait to.

    Returns
    Type Description
    Boolean

    True if the trait is equal to the type passed as argument; otherwise, false.

    See Also

    Binary.Tag
    Binary.Marker
    Query
    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