Implement Loot Box in Game
This requires you to have set up a Loot Box in the management interface.
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.
Unity
int assetInstanceID = 90;
LootLockerSDKManager.OpenALootBoxForAssetInstances(assetInstanceID, (response) =>
{
if (response.success)
{
Debug.Log("Successfully opened Loot box");
}
else
{
Debug.Log("Error opening Loot box");
}
});
Before opening a Loot Box we can inspect it to see what the player may get
Unity
int assetInstanceID = 90;
LootLockerSDKManager.InspectALootBoxForAssetInstances(assetInstanceID, (response) =>
{
if (response.success)
{
Debug.Log("Successfully inspected Loot box");
}
else
{
Debug.Log("Error inspecting Loot box");
}
});
Last modified 6mo ago