Setup In-Game Store
Prerequisites
Get The Catalog Items
private void CreateStoreUI()
{
string CatalogKey = "<INSERT KEY>";
int count = 0;
string after = null;
LootLockerSDKManager.ListCatalogItems(CatalogKey, count, after, (response) =>
{
if (!response.success)
{
Debug.Log("Could not List Items from Catalog");
return;
}
LootLockerInlinedCatalogEntry[] inlinedEntryList = response.GetLootLockerInlinedCatalogEntries();
foreach (var entry in inlinedEntryList)
{
switch (entry.entity_kind)
{
case LootLockerCatalogEntryEntityKind.asset:
ConfigureAsset(entry.asset_details);
break;
case LootLockerCatalogEntryEntityKind.currency:
ConfigureCurrency(entry.currency_details);
break;
case LootLockerCatalogEntryEntityKind.progression_points:
ConfigureProgressionPoints(entry.progression_point_details);
break;
case LootLockerCatalogEntryEntityKind.progression_reset:
ConfigureProgressionReset(entry.progression_reset_details);
break;
case LootLockerCatalogEntryEntityKind.group:
ConfigureGroup(entry.group_details);
break;
}
}
});
}
private void ConfigureAsset(LootLockerAssetDetails asset)
{
Debug.Log(asset.name);
Debug.Log(asset.id);
Debug.Log(asset.thumbnail);
}
private void ConfigureCurrency(LootLockerCurrencyDetails currency)
{
Debug.Log(currency.amount);
Debug.Log(currency.name);
Debug.Log(currency.id);
Debug.Log(currency.code);
}
private void ConfigureProgressionPoints(LootLockerProgressionPointDetails progression)
{
Debug.Log(progression.amount);
Debug.Log(progression.name);
Debug.Log(progression.id);
Debug.Log(progression.key);
}
private void ConfigureProgressionReset(LootLockerProgressionResetDetails progression)
{
Debug.Log(progression.name);
Debug.Log(progression.id);
Debug.Log(progression.key);
}
private void ConfigureGroup(LootLockerInlinedGroupDetails group)
{
Debug.Log(group.name);
Debug.Log(group.description);
foreach (var asset in group.assetDetails)
{
ConfigureAsset(asset);
}
foreach (var currency in group.currencyDetails)
{
ConfigureCurrency(currency);
}
foreach (var progression in group.progressionPointDetails)
{
ConfigureProgressionPoints(progression);
}
foreach (var progression in group.progressionResetDetails)
{
ConfigureProgressionReset(progression);
}
}Conclusion
Last updated
Was this helpful?





