docs.unity3d.com
Search Results for

    Show / Hide Table of Contents

    Method SetQuantity

    SetQuantity(string, int)

    Sets the quantity of the specified InventoryItem by InventoryItemDefinition Id in this Inventory.

    Declaration
    public void SetQuantity(string itemDefinitionId, int quantity)
    Parameters
    Type Name Description
    string itemDefinitionId

    The Id of the InventoryItemDefinition to set quantity for.

    int quantity

    The new quantity for specified InventoryItemDefinition.

    SetQuantity(int, int)

    Sets the quantity of the specified InventoryItem by InventoryItemDefinition Hash in this Inventory.

    Declaration
    public void SetQuantity(int itemDefinitionHash, int quantity)
    Parameters
    Type Name Description
    int itemDefinitionHash

    The Hash of the InventoryItemDefinition to set.

    int quantity

    The new quantity for the specified InventoryItemDefinition.

    SetQuantity(InventoryItem, int)

    Sets the quantity of the InventoryItem instance within this Inventory.

    Declaration
    public void SetQuantity(InventoryItem item, int quantity)
    Parameters
    Type Name Description
    InventoryItem item

    The InventoryItem to set quantity for in this Inventory.

    int quantity

    The new value for quantity for this InventoryItem.

    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)