docs.unity3d.com
Search Results for

    Show / Hide Table of Contents

    Method ResetStat

    ResetStat(StatDefinition)

    Resets the stat to the default value of its given definition.

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

    The StatDefinition to reset for this GameItem instance.

    Returns
    Type Description
    StatValue

    true if the stat is successfully reset, false otherwise.

    Exceptions
    Type Condition
    NullReferenceException

    If this GameItem has been discarded

    ArgumentNullException

    If the statDefinition is null.

    ResetStat(string)

    Resets the stat to the default value of its given definition.

    Declaration
    public StatValue ResetStat(string statDefinitionId)
    Parameters
    Type Name Description
    string statDefinitionId

    The identifier of the StatDefinition to reset for this GameItem instance.

    Returns
    Type Description
    StatValue

    true if the stat is successfully reset, false otherwise.

    Exceptions
    Type Condition
    NullReferenceException

    If this GameItem has been discarded

    ArgumentNullException

    If the statDefinitionId is null, empty, or whitespace.

    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)