docs.unity3d.com
Search Results for

    Show / Hide Table of Contents

    Method ResetToDefaultValue

    ResetToDefaultValue(GameItem, StatDefinition)

    Reset Stat to the correct default value.

    Declaration
    public static StatValue ResetToDefaultValue(GameItem gameItem, StatDefinition statDefinition)
    Parameters
    Type Name Description
    GameItem gameItem

    GameItem to reset to default value.

    StatDefinition statDefinition

    StatDefinition this method is to act upon.

    Returns
    Type Description
    StatValue

    Default value of specified StatDefinition on specified GameItem.

    Exceptions
    Type Condition
    ArgumentNullException

    If the gameItem argument is null.

    ArgumentNullException

    If the statDefinition argument is null.

    StatDefinitionNotFoundException

    If the StatDefinition is not found.

    InvalidCastException

    If the StatValueType doesn't match StatDefinition.

    DetailNotFoundException

    If the StatDetail is not found on GameItem.

    ResetToDefaultValue(GameItem, string)

    Reset Stat to the correct default value.

    Declaration
    public static StatValue ResetToDefaultValue(GameItem gameItem, string statDefinitionId)
    Parameters
    Type Name Description
    GameItem gameItem

    GameItem upon which Stat is to be reset.

    string statDefinitionId

    Id of StatDefinition this method is to act upon.

    Returns
    Type Description
    StatValue

    Default value of specified StatDefinition on specified GameItem.

    Exceptions
    Type Condition
    ArgumentNullException

    If the gameItem argument is null.

    ArgumentException

    If the statDefinitionId is null or empty.

    StatDefinitionNotFoundException

    If the StatDefinition is not found.

    InvalidCastException

    If the StatValueType doesn't match StatDefinition.

    DetailNotFoundException

    If the StatDetail is not found on GameItem.

    ResetToDefaultValue(string, StatDefinition)

    Reset Stat to the correct default value.

    Declaration
    public static StatValue ResetToDefaultValue(string gameItemId, StatDefinition statDefinition)
    Parameters
    Type Name Description
    string gameItemId

    GameItem upon which StatManager is to reset stat value.

    StatDefinition statDefinition

    StatDefinition this method is to act upon.

    Returns
    Type Description
    StatValue

    Default value of specified StatDefinition on specified GameItem.

    Exceptions
    Type Condition
    ArgumentNullException

    If the statDefinition argument is null.

    ArgumentException

    If the gameItemId is null or empty.

    InventoryItemNotFoundException

    If the gameItemId is not found.

    StatDefinitionNotFoundException

    If the StatDefinition is not found.

    InvalidCastException

    If the StatValueType doesn't match StatDefinition.

    DetailNotFoundException

    If the StatDetail is not found on GameItem.

    ResetToDefaultValue(string, string)

    Reset Stat to the correct default value.

    Declaration
    public static StatValue ResetToDefaultValue(string gameItemId, string statDefinitionId)
    Parameters
    Type Name Description
    string gameItemId

    GameItem upon which StatManager is to reset stat value.

    string statDefinitionId

    Id of StatDefinition this method is to act upon.

    Returns
    Type Description
    StatValue

    Default value of specified StatDefinition on specified GameItem.

    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.

    StatDefinitionNotFoundException

    If the StatDefinition is not found.

    InvalidCastException

    If the StatValueType doesn't match StatDefinition.

    DetailNotFoundException

    If the StatDetail is not found on GameItem.

    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)