docs.unity3d.com
Search Results for

    Show / Hide Table of Contents

    Method AddDefaultItem

    AddDefaultItem(InventoryItemDefinition, int)

    Adds the given default item to this InventoryDefinition. Note: this thows if item without a CurrencyDetailDefinition is added to the wallet.

    Declaration
    public override bool AddDefaultItem(InventoryItemDefinition itemDefinition, int quantity = 0)
    Parameters
    Type Name Description
    InventoryItemDefinition itemDefinition

    The default InventoryItemDefinition to add.

    int quantity

    Quantity of items to add (defaults to 0).

    Returns
    Type Description
    bool

    Whether or not the adding was successful.

    Overrides
    BaseCollectionDefinition<InventoryDefinition, Inventory, InventoryItemDefinition, InventoryItem>.AddDefaultItem(InventoryItemDefinition, int)

    AddDefaultItem(DefaultItem)

    Adds the given default item to this InventoryDefinition. Note: this thows if item without a CurrencyDetailDefinition is added to the wallet.

    Declaration
    public override bool AddDefaultItem(DefaultItem defaultItem)
    Parameters
    Type Name Description
    DefaultItem defaultItem

    The DefaultItem to add.

    Returns
    Type Description
    bool

    Whether or not the DefaultItem was added successfully.

    Overrides
    BaseCollectionDefinition<InventoryDefinition, Inventory, InventoryItemDefinition, InventoryItem>.AddDefaultItem(DefaultItem)
    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)