docs.unity3d.com
Search Results for

    Show / Hide Table of Contents

    Method AdjustStatFloat

    AdjustStatFloat(string, float)

    Adjusts the float Stat with corresponding statDefinitionId by specified amount.

    Declaration
    public float AdjustStatFloat(string statDefinitionId, float change)
    Parameters
    Type Name Description
    string statDefinitionId

    Stat statDefinitionId to adjust.

    float change

    Change in value to the Stat.

    Returns
    Type Description
    float

    The new value of Stat on this GameItem.

    Exceptions
    Type Condition
    NullReferenceException

    The parameter doesn't exist in the stats catalog.

    InvalidOperationException

    The parameter refers to a stat of a different type.

    ArgumentNullException

    The stat parameter is null or empty.

    AdjustStatFloat(int, float)

    Sets the float Stat with corresponding statDefinitionHash by specified amount.

    Declaration
    public float AdjustStatFloat(int statDefinitionHash, float change)
    Parameters
    Type Name Description
    int statDefinitionHash

    Stat statDefinitionHash to adjust.

    float change

    Change in value to the Stat.

    Returns
    Type Description
    float

    The new value of Stat on this GameItem.

    Exceptions
    Type Condition
    NullReferenceException

    The parameter doesn't exist in the stats catalog.

    InvalidOperationException

    The parameter refers to a stat of a different type.

    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)