Asset Layer Docs
Asset LayerAPI Docs
  • 👋Welcome
  • Getting Started
    • Quick Start
      • Quick Start for Developers
      • Quick Start for Creators
      • Quick Start for Unity
    • Core Concepts
      • Users
      • Auth + Permissions
      • Teams
      • Apps
      • Slots
      • Expressions
      • Assets + Collections
      • Currencies
      • Marketplace and Shops
      • Core Concepts in Action
    • SDK Docs
      • Setup
      • Users
        • getUser()
      • Apps
        • info()
        • getApp()
        • getApps()
        • slots()
        • getAppSlots()
        • getAppSlotIds()
      • Slots
        • getSlot()
        • collections()
        • getSlotCollections()
        • getSlotCollectionIds()
        • getSlotExpressions()
        • createExpression()
        • updateExpression()
        • getExpressionTypes()
      • Collections
        • info()
        • getCollection()
        • getCollections()
        • assets()
        • getCollectionAssets()
        • getCollectionAssetIds()
        • createCollection()
        • updateCollection()
        • updateCollectionImage()
        • activateCollection()
        • deactivateCollection()
      • Assets
        • info()
        • getAsset()
        • getAssets()
        • user()
        • getUserAssets()
        • getUserAssetIds()
        • getUserAssetCounts()
        • getUserCollectionAssets()
        • getUserCollectionsAssets()
        • getUserSlotAssets()
        • getUserSlotsAssets()
        • mintAssets()
        • send()
        • sendAsset()
        • sendAssets()
        • sendCollectionAssets()
        • sendLowestAsset()
        • sendRandomAsset()
        • update()
        • updateAsset()
        • updateAssets()
        • updateCollectionAssets()
        • expressionValues()
        • updateAssetExpressionValue()
        • updateAssetsExpressionValue()
        • updateCollectionAssetsExpressionValue()
        • updateBulkExpressionValues()
      • Equips
        • getEquips()
        • setEquip()
        • removeEquip()
      • Currencies
        • info()
        • getCurrency()
        • balance()
        • getCurrencyBalance()
        • getCurrencySummary()
        • increaseCurrencyBalance()
        • decreaseCurrencyBalance()
        • transferCurrency()
      • Listings
        • getListing()
        • user()
        • getUserListings()
        • getUserListingsCounts()
        • getUserCollectionListings()
        • getUserCollectionListingsCounts()
        • getUserSales()
        • getUserSalesCounts()
        • getUserPurchases()
        • getUserPurchasesCounts()
        • collection()
        • getCollectionListings()
        • getCollectionsListings()
        • getCollectionListingsCounts()
        • getCollectionsListingsCounts()
        • getCollectionListingsStats()
        • getCollectionsListingsStats()
        • app()
        • getAppListings()
        • getAppListingsCounts()
        • getAppListingsStats()
        • new()
        • listAsset()
        • listAssets()
        • listCollectionAssets()
        • updateListing()
        • buyListing()
        • removeListing()
      • Shop
        • buyItem()
        • summary()
      • Core Types
        • User
        • App
        • Slot
        • Expression
        • Collection
        • Asset
        • Equip
        • Currency
        • Listing
        • Shop
        • Basic
      • SDK Repo
      • C# SDK for Unity
    • Guides
      • How to Integrate Asset Layer into your Unity Game
    • API Docs
    • Asset Layer GPT
  • Build an app
    • App Setup
      • Creating an App
      • Managing Apps
      • App Info
      • Manage Permissions
      • Manage Slots
      • Manage Collections
      • Manage Currencies
      • App Settings
    • App Development
    • Build With Unity
      • Unity App Setup
      • Advanced Unity Setup
        • WebGL App Setup
      • Asset Layer Unity SDK
        • Login + Authentication
        • Create Assets in Unity
        • Import Assets Into Your Scene
        • Inventory Manager
        • Sync Your Assets
        • Asset Layer Game Server
        • C# SDK
    • Sample App
      • Getting Started With Sample App Locally
      • Environment Variables
      • API Routes
      • Deployment
      • Default Pages
      • Deploying Your Unity WebGL Game Through Sample App
  • Create and Manage Assets
    • Create Assets With Code
    • Create Assets Without Code
      • Create Assets for My App
      • Submit a Collection for a 3rd Party App
      • Create an Independent Collection - Coming Soon!
    • Create Assets in Unity
    • Managing Collections from 3rd Party Creators
  • Manage Assets
    • My Assets
      • Listing Assets for Sale
      • Sending Assets as a Gift
      • My Listings
      • Marketplace History
    • Marketplace
  • Settings
    • Team Settings
    • Account Settings
    • Pricing
  • Details
    • Expression Types
      • Image
      • Audio
      • Video
      • Unity
      • Spine 4.0 (2D Animated Characters)
      • Additional Expression Types
Powered by GitBook
On this page
  • Adding the Inventory Manager to your Scene
  • Toggling Inventory
  • Configuring the Inventory Manager
  • Handling The Selection
  1. Build an app
  2. Build With Unity
  3. Asset Layer Unity SDK

Inventory Manager

PreviousImport Assets Into Your SceneNextSync Your Assets

Last updated 1 year ago

The Asset Layer SDK includes an inventory manager ready to use out of the box. It offers various options for users to select assets. By default, users begin by viewing all slots of your app, then filter down to the assets they wish to use.

Adding the Inventory Manager to your Scene

You can find the Inventory prefab in Assets/AssetLayerUnitySDK/Prefabs. To add the inventory manager to your scene, simply drag the prefab into your scene.

Toggling Inventory

By default, the inventory menu in the scene is toggled by pressing 'i'. To open the inventory through other methods, call the ToggleInventory function of the InventoryManagerUnityUI, for example, from a button as illustrated below.

Furthermore, you can customize the toggle key by selecting the 'ToggleKey' option. You can also completely disable key-based toggling by turning off the 'Use Toggle Key' option in the Inventory Script.

An additional simple method to toggle the inventory is to assign a GameObject with a Button component to the ToggleElement field in the InventoryUIManagerUnityUI script on the Inventory prefab. This automatically enables the button to toggle the inventory on and off.

Configuring the Inventory Manager

To configure your Inventory, you can set the following fields.

Menu Name: This will set the title of the inventory manager in your scene.

Slot Id: Allows specifying a particular slot for automatic selection at startup.

Display All: When enabled with a slot ID specified, users see all assets in that slot immediately, bypassing the need for filtering across collections. Slot Ids: For user selection from multiple slots, filter the slots IDs they can select from here by specifiying the ones the can select from. Users choose a slot, then a collection where they own assets, and finally select an individual asset.

Auto Select: With 'Auto Select' enabled, 'Display All' active, and no prior asset selection, it automatically chooses an asset for the user at startup. This is useful for immediate gameplay with a default character, allowing users to later switch to other assets.

Close On Selection: When disabled, the inventory remains open after an asset is selected.

Asset Expression Id: Defines the Expression Id to load from the selected assets. If unset, an appropriate expression type is automatically chosen.

Handling The Selection

Methods to be executed upon the selection of an asset can be assigned through the 'On Asset Selection' field. This is automatically assigned by the AssetLayerGameObject prefab, so there's no need to set this unless you have specific logic you wish to execute.

Toggle Inventory