docs.unity3d.com
Search Results for

    Show / Hide Table of Contents

    Method TryGetValue

    TryGetValue(GameItem, StatDefinition, out StatValue)

    Try to get specified StatDefinition from specified GameItem and output StatValue, if found.

    Declaration
    public static bool TryGetValue(GameItem gameItem, StatDefinition statDefinition, out StatValue value)
    Parameters
    Type Name Description
    GameItem gameItem

    The GameItem to check for specified StatDefinition.

    StatDefinition statDefinition

    StatDefinition this method is to act upon.

    StatValue value

    StatValue if found.

    Returns
    Type Description
    bool

    True if specified Stat exists and is set on specified GameItem, else false.

    Exceptions
    Type Condition
    ArgumentNullException

    If the gameItem argument is null.

    ArgumentNullException

    If the statDefinition argument is null.

    DetailNotFoundException

    If the StatDetail is not found on GameItem.

    StatDefinitionNotFoundException

    If the StatDefinition is not found.

    TryGetValue(GameItem, string, out StatValue)

    Search for specified StatDefinition from specified GameItem and output StatValue, if found.

    Declaration
    public static bool TryGetValue(GameItem gameItem, string statDefinitionId, out StatValue value)
    Parameters
    Type Name Description
    GameItem gameItem

    The GameItem to check for specified StatDefinition.

    string statDefinitionId

    Id of StatDefinition this method is to act upon.

    StatValue value

    StatValue if found.

    Returns
    Type Description
    bool

    True if specified Stat exists and is set on specified GameItem, else false.

    Exceptions
    Type Condition
    ArgumentNullException

    If the gameItem argument is null.

    ArgumentException

    If the statDefinitionId is null or empty.

    DetailNotFoundException

    If the StatDetail is not found on GameItem.

    StatDefinitionNotFoundException

    If the StatDefinition is not found.

    TryGetValue(string, StatDefinition, out StatValue)

    Search for specified StatDefinition from specified GameItem and output StatValue, if found.

    Declaration
    public static bool TryGetValue(string gameItemId, StatDefinition statDefinition, out StatValue value)
    Parameters
    Type Name Description
    string gameItemId

    GameItem upon which StatManager is to check for stat.

    StatDefinition statDefinition

    StatDefinition this method is to act upon.

    StatValue value

    StatValue if found.

    Returns
    Type Description
    bool

    True if specified Stat exists and is set on specified GameItem, else false.

    Exceptions
    Type Condition
    ArgumentException

    If the gameItemId is null or empty.

    InventoryItemNotFoundException

    If the gameItemId is not found.

    ArgumentNullException

    If the statDefinition argument is null.

    DetailNotFoundException

    If the StatDetail is not found on GameItem.

    StatDefinitionNotFoundException

    If the StatDefinition is not found.

    TryGetValue(string, string, out StatValue)

    Search for specified StatDefinition from specified GameItem and output StatValue, if found.

    Declaration
    public static bool TryGetValue(string gameItemId, string statDefinitionId, out StatValue value)
    Parameters
    Type Name Description
    string gameItemId

    GameItem upon which StatManager is to check for stat.

    string statDefinitionId

    Id of StatDefinition this method is to act upon.

    StatValue value

    StatValue if found.

    Returns
    Type Description
    bool

    True if specified Stat exists and is set on specified GameItem, else false.

    Exceptions
    Type Condition
    ArgumentException

    If the gameItemId is null or empty.

    InventoryItemNotFoundException

    If the gameItemId is not found.

    ArgumentException

    If the statDefinitionId is null or empty.

    DetailNotFoundException

    If the StatDetail is not found on GameItem.

    StatDefinitionNotFoundException

    If the StatDefinition is not found.

    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)