Assets
Wether you have only a few or many Assets in your game, it's great to be familiar with managing them so that you can find, edit, and activate (or deactivate) them easily and quickly.
If your game has a lot of different Assets, you might want to search or organize your Asset Manager screen. To search for an Asset, enter your search terms into the search box in the top right corner of the Asset Manager screen.

Assets in the Asset Manager are sorted by Context by default. To sort by a different filter, click the title of the column in the Asset Manager. To edit the columns that are visible in the Asset Manager, click the cog icon next to the search bar.

To edit an Asset’s data, click on the
Edit
button associated with the Asset you would like to edit on the right side of the Asset Manager screen.
It is only possible to make edits to an Asset while in the Staging Environment. Learn more about the different environments here.
By default, new Assets are inactive. An inactive Asset is not sent to your game and cannot be granted to a player. To activate an Asset, click the green
Activate
button when editing an Asset. Similarly, to deactivate an Asset, click the red Deactivate
button.
If you deactivate an Asset it will be hidden from your player's inventories
To start retrieving assets you can run following:
Unity
int count = 10;
LootLockerSDKManager.GetAssetListWithCount(count, (response) =>
{
if (response.success)
{
Debug.Log("Successfully retrieved " + response.assets.Length + " assets");
}
else
{
Debug.Log("Error retrieving assets");
}
});
After the initial method has completed retrieving assets you can call this method to get more:
Unity
LootLockerSDKManager.GetAssetNextList(count, (response) =>
{
if (response.success)
{
Debug.Log("Successfully retrieved second batch of " + response.assets.Length + " assets");
}
else
{
Debug.Log("Error retrieving assets");
}
});
If you want to retrieve all you asets you can keep calling the method until you stop receiving assets.
After finishing retrieving the assets you need, it's best practice to run the following code, as if you try to get assets later, you might start from your previous last retrieved asset.
Unity
LootLockerSDKManager.ResetAssetCalls();
Unity
int count = 10;
List<LootLocker.LootLockerEnums.AssetFilter> filter = new List<LootLocker.LootLockerEnums.AssetFilter>() { LootLocker.LootLockerEnums.AssetFilter.nonpurchasable };
LootLockerSDKManager.GetAssetListWithCount(count, (response) =>
{
if (response.success)
{
Debug.Log("Successfully retrieved " + response.assets.Length + " assets");
}
else
{
Debug.Log("Error retrieving assets");
}
}, filter);
If you already know the IDs of the assets you wish to get, you can use this method to retrieve them specifically.
Unity
string[] list = new string[] { "8111" };
LootLockerSDKManager.GetAssetsById(list, (response) =>
{
if (response.success)
{
Debug.Log("Successfully retrieved " + response.assets.Length + " assets");
Debug.Log("First Asset ID: " + response.assets[0].id);
}
else
{
Debug.Log("Error retrieving assets");
}
});
Unity
LootLockerSDKManager.ListFavouriteAssets((response) =>
{
if (response.success)
{
Debug.Log("Successfully retrieved " + response.favourites.Length + " assets");
if (response.favourites.Length > 0)
{
Debug.Log("First Asset ID: " + response.favourites[0]);
} else
{
Debug.Log("No favourite assets");
}
}
else
{
Debug.Log("Error retrieving assets");
}
});
Unity
LootLockerSDKManager.AddFavouriteAsset("8111", (response) =>
{
if (response.success)
{
Debug.Log("Successfully favourited asset");
}
else
{
Debug.Log("Error favouriting asset");
}
});
Unity
LootLockerSDKManager.RemoveFavouriteAsset("8111", (response) =>
{
if (response.success)
{
Debug.Log("Successfully removed favourite asset");
}
else
{
Debug.Log("Error removing favourite asset");
}
});
Unity
LootLockerSDKManager.GetAllKeyValuePairsToAnInstance(45781352, (response) =>
{
if (response.success)
{
if (response.storage.Length > 0)
{
Debug.Log("Successfully retrieved " + response.storage.Length + " key value pairs");
}
else
{
Debug.Log("No key value pairs for asset instance");
}
}
else
{
Debug.Log("Error retrieving assets");
}
});
Unity
int assetInstanceID = 84;
int keyValueID = 1;
LootLockerSDKManager.GetAKeyValuePairByIdForAssetInstances(assetInstanceID, keyValueID, (response) =>
{
if (response.success)
{
Debug.Log("Successfully retrieved key value pair");
}
else
{
Debug.Log("Error retrieving key value pair");
}
});
Unity
LootLockerSDKManager.CreateKeyValuePairForAssetInstances(45781352, "some-new-key", "value here", (response) =>
{
if (response.success)
{
Debug.Log("Successfully created key value pair for asset instance");
}
else
{
Debug.Log("Error creating key value pair");
}
});
Unity
int assetInstanceID = 84;
Dictionary<string, string> multipleTestKeys = new Dictionary<string, string>();
multipleTestKeys.Add("some-new-key", "Some value");
multipleTestKeys.Add("some-other-key", "Some other value");
LootLockerSDKManager.UpdateOneOrMoreKeyValuePairForAssetInstances(assetInstanceID, multipleTestKeys, (response) =>
{
if (response.success)
{
Debug.Log("Successfully updated key value pairs");
}
else
{
Debug.Log("Error updating key value pairs");
}
});
Unity
int assetInstanceID = 84;
int keyValuePairID = 1;
LootLockerSDKManager.DeleteKeyValuePairForAssetInstances(assetInstanceID, keyValuePairID, (response) =>
{
if (response.success)
{
Debug.Log("Successfully removed key value pair");
}
else
{
Debug.Log("Error removing key value pair");
}
});
Last modified 1mo ago