docs.unity3d.com
Search Results for

    Show / Hide Table of Contents

    Class GameItem

    Base class for runtime instances in Game Foundation.

    Inheritance
    object
    GameItem
    InventoryItem
    Namespace: UnityEngine.GameFoundation
    Assembly: solution.dll
    Syntax
    public abstract class GameItem

    Properties

    Name Description
    definition

    The dfinition of this GameItem instance.

    discarded

    Determines if this GameItem instance has been discarded (removed from Game Foundation). GameItem instances being standard objets, they cannot be destroyed and garbage collected while all their references are not set to null. The discarded property is a way for you to know if the object is still active within Game Foundation.

    id

    The unique identifier of this GameItem instance.

    Methods

    Name Description
    AdjustStat(string, StatValue)

    Adjusts the value of the StatDefinition by its given statDefinitionId by adding the change to its current value.

    AdjustStat(StatDefinition, StatValue)

    Adjusts the stat by specified amount.

    AssertActive()

    Throws a NullReferenceException if this GameItem is discarded.

    Equals(object)

    Determines whether the specified object is equal to the current object.

    ~GameItem()

    in finalizer, remove gameItem from gameItem instance lookup

    GetHashCode()

    Serves as the default hash function.

    GetStat(string)

    Gets the value of the StatDefinition by its given id for this GameItem instance.

    GetStat(StatDefinition)

    Gets the value of the given statDefinition for this GameItem instance.

    HasStat(string)

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

    HasStat(StatDefinition)

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

    ResetStat(string)

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

    ResetStat(StatDefinition)

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

    SetStat(string, StatValue)

    Sets the value of the StatDefinition by its given statDefinitionId for this GameItem instance.

    SetStat(StatDefinition, StatValue)

    Sets the value of the given statDefinition for this GameItem instance.

    Events

    Name Description
    removed

    Event triggered right after this GameItem is removed.

    statChanged

    Event triggered when a stat is updated.

    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)