docs.unity3d.com
Search Results for

    Show / Hide Table of Contents

    Method TryGetFloatValue

    TryGetFloatValue(GameItem, string, out float)

    Tries to get specified Stat for specified GameItem and set out variable, if found.

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

    GameItem upon which Stat is to be inspected.

    string statDefinitionId

    StatDefinition's Id to search for.

    float value

    Current value of Stat, if found for this GameItem.

    Returns
    Type Description
    bool

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

    TryGetFloatValue(GameItem, int, out float)

    Tries to get specified Stat for specified GameItem and set out variable, if found.

    Declaration
    public static bool TryGetFloatValue(GameItem gameItem, int statDefinitionHash, out float value)
    Parameters
    Type Name Description
    GameItem gameItem

    GameItem upon which Stat is to be inspected.

    int statDefinitionHash

    StatDefinition's Hash to search for.

    float value

    Current value of Stat, if found for this GameItem.

    Returns
    Type Description
    bool

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

    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)