Work with Loot Boxes In-Game
Open Loot Box
After the player has either purchased or have been awarded a loot box they can open it.
This will remove the loot box from their inventory and grant them the item from the loot box.
To see what items were granted by the Loot box you can use the Grant Notifications Method
int assetInstanceID = 90;
LootLockerSDKManager.OpenALootBoxForAssetInstances(assetInstanceID, (response) =>
{
if (response.success)
{
Debug.Log("Successfully opened Loot box");
}
else
{
Debug.Log("Error opening Loot box");
}
});
Inspect Loot Box
Before opening a Loot Box we can inspect it to see what the player may get
int assetInstanceID = 90;
LootLockerSDKManager.InspectALootBoxForAssetInstances(assetInstanceID, (response) =>
{
if (response.success)
{
Debug.Log("Successfully inspected Loot box");
}
else
{
Debug.Log("Error inspecting Loot box");
}
});
Last updated