docs.unity3d.com
Search Results for

    Show / Hide Table of Contents

    Class InventoryItem

    Item handled by the InventoryManager.

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

    Properties

    Name Description
    definition

    The definition used to create this item.

    hasBeenDiscarded

    Determines if this item has been discarded (removed from Game Foundation). Items being standard objects, they cannot be destroyed and garbage collected as long as all their references are not set to null.

    This property is a way for you to know if the object is still active within Game Foundation.

    id

    The unique identifier of this item.

    Methods

    Name Description
    AdjustProperty(string, Property)

    Adjust the value of the property with the given key by adding the given change to its current value. Work only with numeric properties.

    AssertActive()

    Throws a NullReferenceException if this InventoryItem is discarded.

    Equals(object)

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

    GetDefaultProperties()

    Get all default properties stored in this definition.

    GetDefaultProperties(Dictionary<string, Property>)

    Get all default properties stored in this definition.

    GetDefaultProperty(string)

    Get the default value of the property with the given propertyKey.

    GetHashCode()

    Serves as the default hash function.

    GetProperties()

    Get all properties stored in this item.

    GetProperties(Dictionary<string, Property>)

    Get all properties stored in this item.

    GetProperty(string)

    Get the value of the property with the given key.

    HasProperty(string)

    Check if this item has a property for the given key.

    ResetProperty(string)

    Reset the property with the given key to its default value.

    SetProperty(string, Property)

    Set the property with the given key with the given value.

    TryGetDefaultProperty(string, out Property)

    Try to get the default value of the property with the given propertyKey.

    TryGetProperty(string, out Property)

    Try to get the value of the property with the given key.

    Events

    Name Description
    propertyChanged

    Event triggered when a property 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)