docs.unity3d.com
Search Results for

    Show / Hide Table of Contents

    Method GetPayload

    GetPayload<T>(int)

    Retrieves a reference to a payload stored in the runtime asset.

    Declaration
    public ref T GetPayload<T>(int payload) where T : struct
    Parameters
    Type Name Description
    int payload

    Identifies the payload that should be retrieved.

    Returns
    Type Description
    T

    Reference to the payload that corresponds to the index passed as argument.

    Type Parameters
    Name Description
    T

    GetPayload<T>(TraitIndex)

    Retrieves the associated payload (i.e. the instance of the user-defined value) for a given trait index.

    Declaration
    public ref T GetPayload<T>(Binary.TraitIndex traitIndex) where T : struct
    Parameters
    Type Name Description
    Binary.TraitIndex traitIndex

    The trait index for which the corresponding payload is to be retrieved.

    Returns
    Type Description
    T

    Reference to the user-defined value that corresponds to the trait index passed as argument.

    Type Parameters
    Name Description
    T
    In This Article
    Back to top
    Copyright © 2024 Unity Technologies — Trademarks and terms of use
    • Legal
    • Privacy Policy
    • Cookie Policy
    • Do Not Sell or Share My Personal Information
    • Your Privacy Choices (Cookie Settings)