docs.unity3d.com
Search Results for

    Show / Hide Table of Contents

    Method AdjustStatInt

    AdjustStatInt(string, int)

    Adjusts the int Stat with corresponding statDefinitionId by specified amount.

    Declaration
    public int AdjustStatInt(string statDefinitionId, int change)
    Parameters
    Type Name Description
    string statDefinitionId

    Stat statDefinitionId to adjust.

    int change

    Change in value to the Stat.

    Returns
    Type Description
    int

    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 parameter is null or empty.

    AdjustStatInt(int, int)

    Adjusts the int Stat with corresponding statDefinitionHash by specified amount.

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

    Stat statDefinitionHash to adjust.

    int change

    Change in value to the Stat.

    Returns
    Type Description
    int

    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)