docs.unity.cn
    Show / Hide Table of Contents

    Class StackableInventoryItem

    Stackable item handled by the IInventoryManager.

    Inheritance
    Object
    InventoryItem
    StackableInventoryItem
    Inherited Members
    InventoryItem.id
    InventoryItem.definition
    InventoryItem.hasBeenDiscarded
    InventoryItem.m_ItemCollections
    InventoryItem.GetItemCollections(ICollection<IItemCollection>, Boolean)
    InventoryItem.RemoveFromAllItemCollections()
    InventoryItem.AssertActive()
    InventoryItem.GetHashCode()
    InventoryItem.Equals(Object)
    InventoryItem.mutablePropertyChanged
    InventoryItem.GetMutableProperties()
    InventoryItem.GetMutableProperties(Dictionary<String, Property>)
    InventoryItem.HasMutableProperty(String)
    InventoryItem.GetMutableProperty(String)
    InventoryItem.TryGetMutableProperty(String, Property)
    InventoryItem.SetMutableProperty(String, Property)
    InventoryItem.AdjustMutableProperty(String, Property)
    InventoryItem.ResetMutableProperty(String)
    InventoryItem.GetDefaultValuesOfMutableProperties()
    InventoryItem.GetDefaultValuesOfMutableProperties(Dictionary<String, Property>)
    InventoryItem.GetDefaultValueOfMutableProperty(String)
    InventoryItem.TryGetDefaultValueOfMutableProperty(String, Property)
    Namespace: UnityEngine.GameFoundation
    Syntax
    public class StackableInventoryItem : InventoryItem, IEquatable<InventoryItem>, IComparable<InventoryItem>, ITradable, IQuantifiable

    Properties

    quantity

    Quantity of this StackableInventoryItem.

    Declaration
    public long quantity { get; }
    Property Value
    Type Description
    Int64
    Implements
    IQuantifiable.quantity

    Methods

    SetQuantity(Int64)

    Set quantity for this StackableInventoryItem if permissible.

    Declaration
    public bool SetQuantity(long quantity)
    Parameters
    Type Name Description
    Int64 quantity

    Requested new quantity.

    Returns
    Type Description
    Boolean

    true if new quantity is valid and set, else false.

    Events

    quantityChanged

    Triggered every time a StackableInventoryItem quantity is changed.

    Declaration
    public static event Action<StackableInventoryItem, long> quantityChanged
    Event Type
    Type Description
    Action<StackableInventoryItem, Int64>
    Back to top Copyright © 2020 Unity Technologies
    Generated by DocFX
    on 16 June 2021