docs.unity3d.com
Search Results for

    Show / Hide Table of Contents

    Method GetStat

    GetStat(StatDefinition)

    Gets the value of the given statDefinition for this GameItem instance.

    Declaration
    public StatValue GetStat(StatDefinition statDefinition)
    Parameters
    Type Name Description
    StatDefinition statDefinition

    The StatDefinition to get the value from.

    Returns
    Type Description
    StatValue

    The value of the StatDefinition in this GameItem instance.

    Exceptions
    Type Condition
    NullReferenceException

    If this GameItem instance has been discarded.

    GetStat(string)

    Gets the value of the StatDefinition by its given id for this GameItem instance.

    Declaration
    public StatValue GetStat(string statDefinitionId)
    Parameters
    Type Name Description
    string statDefinitionId
    Returns
    Type Description
    StatValue

    The value of the StatDefinition in this GameItem instance.

    Exceptions
    Type Condition
    NullReferenceException

    If this GameItem instance has been discarded.

    ArgumentNullException

    If the id parameter is null or empty.

    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)