docs.unity3d.com
Search Results for

    Show / Hide Table of Contents

    Method CreateItem

    CreateItem(string)

    This will create a new InventoryItem based on the InventoryItemDefinition matching the given id.

    Declaration
    public static InventoryItem CreateItem(string definitionId)
    Parameters
    Type Name Description
    string definitionId

    The Id of the InventoryItemDefinition to assign to this Item.

    Returns
    Type Description
    InventoryItem

    The newly created item based on specified InventoryItemDefinition.

    CreateItem(InventoryItemDefinition)

    This will create a new InventoryItem based on the given InventoryItemDefinition.

    Declaration
    public static InventoryItem CreateItem(InventoryItemDefinition itemDefinition)
    Parameters
    Type Name Description
    InventoryItemDefinition itemDefinition

    The InventoryItemDefinition to assign to this Item.

    Returns
    Type Description
    InventoryItem

    The newly created item based on specified InventoryItemDefinition.

    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)