|
| PlayerInventory (InventoryService inventoryApi, IPlatformService platformService, INotificationService notificationService, CoroutineService coroutineService, IDependencyProvider provider, CoreConfiguration config, IContentApi contentService, IConnectivityService connectivityService, ISdkEventService sdkEventService) |
|
PlayerCurrency | GetCurrency (CurrencyRef currencyRef) |
| Get a player's currency data for a given type. More...
|
|
PlayerItemGroup | GetItems (ItemRef itemRef=null) |
| Get a category of PlayerItem for a given type. If you have subtypes of ItemContent, and you get an item group for a basetype of ItemContent, the resultant PlayerItemGroup will have all instances from all subclasses of the given type. More...
|
|
Promise | Update (Action< InventoryUpdateBuilder > updateBuilder, string transaction=null) |
|
Promise | Update (InventoryUpdateBuilder updateBuilder, string transaction=null) |
| Make an atomic update to the player's inventory state. If you are offline, then this function changes based on your CoreConfiguration.InventoryOfflineMode setting. More...
|
|
async Promise | Refresh () |
| Refreshes all PlayerItemGroups that have been established using GetItems, and refreshes currencies Currencies More...
|
|
The player's inventory can have Currencies, and items, which can be accessed via GetItems
Make an atomic update to the player's inventory state. If you are offline, then this function changes based on your CoreConfiguration.InventoryOfflineMode setting.
Configure the InventoryUpdateBuilder with the modifications you'd like to make to the player's inventory.
Note that by default, you cannot update currency or items, because they can only be set from Beamable Microservices, or the Beamable Platform itself. However, you can mark individual CurrencyContent and ItemContent objects as editable by setting their CurrencyContent.clientPermission writeSelf property.
- Parameters
-
updateBuilder | A InventoryUpdateBuilder containing actions to apply to the player's inventory |
transaction | An optional transaction id for the operation. |
- Returns
- A promise representing the success of the operation.