docs.unity3d.com
Search Results for

    Show / Hide Table of Contents

    Method HasStat

    HasStat(StatDefinition)

    Tells if this GameItem instance has a StatDetail with the given statDefinition references within this detail.

    Declaration
    public bool HasStat(StatDefinition statDefinition)
    Parameters
    Type Name Description
    StatDefinition statDefinition

    The StatDefinition instance to look for

    Returns
    Type Description
    bool

    true if the statDefinition is found, false otherwise.

    Exceptions
    Type Condition
    NullReferenceException

    If this GameItem instance has been discarded.

    ArgumentNullException

    If the statDefinition parameter is null.

    HasStat(string)

    Tells if this GameItem instance has a StatDetail with the given id references within this detail.

    Declaration
    public bool HasStat(string id)
    Parameters
    Type Name Description
    string id

    The identifier of the StatDefinition to look for

    Returns
    Type Description
    bool

    true if the StatDefinition is found within the StatDetail of this GameItem instance, false otherwise.

    Exceptions
    Type Condition
    NullReferenceException

    If this GameItem instance has been discarded.

    ArgumentException

    If the id parameter is null, empty, or whitespace.

    ArgumentNullException

    If there is no StatDefinition identified by this id

    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)