Manage UGC from Game
User-Generated Content is first created as an asset candidate before it is turned into an actual asset in your game and made available to other players. In order to convert an asset candidate into a regular asset needs to be created and completed by the player.
If you have moderation enabled, the asset candidate also needs to be approved through the moderation menu before it shows up as an asset.
Unity
Unreal
string name = "New Asset Candidate";
LootLockerSDKManager.CreatingAnAssetCandidate(name, (response) =>
{
if (response.success)
{
Debug.Log("Successfully created asset candidate with ID: " + response.asset_candidate_id);
}
else
{
Debug.Log("Error asset candidate");
}
});
Unity
Unreal
int assetCandidateID = 12;
bool isCompleted = false;
string name = "new name";
LootLockerSDKManager.UpdatingAnAssetCandidate(assetCandidateID, isCompleted, (response) =>
{
if (response.success)
{
Debug.Log("Successfully updated asset candidate with ID: " + response.asset_candidate.id);
}
else
{
Debug.Log("Error updating asset candidate");
}
}, name);
The boolean "IsCompleted" should be false to Update the asset candidate!
The Boolean "Is Completed", when it is set to true, the Asset Candidate will be sent for moderation, if that is enabled on your game. If Moderation is disabled, the asset will be promoted to an asset.
When Updating the Asset Candidate, it is important to remember that it is not enough to just set the values that you do want to update, you have to set every value. This is due to the fact that empty fields will update. So to update, you will need the data from the non-updated version and update from there.
Unity
Unreal
int assetCandidateID = 12;
string filePath = "Assets/Resources/300.jpg";
string fileName = "300.jpg";
LootLocker.LootLockerEnums.FilePurpose fileType = LootLocker.LootLockerEnums.FilePurpose.primary_thumbnail;
LootLockerSDKManager.AddingFilesToAssetCandidates(assetCandidateID, filePath, fileName, fileType, (response) =>
{
if (response.success)
{
Debug.Log("Successfully added image to asset candidate");
}
else
{
Debug.Log("Error adding image to asset candidate");
}
});
Unity
Unreal
int assetCandidateID = 12;
int fileID = 1;
LootLockerSDKManager.RemovingFilesFromAssetCandidates(assetCandidateID, fileID, (response) =>
{
if (response.success)
{
Debug.Log("Successfully removed file from asset candidate");
}
else
{
Debug.Log("Error removing file from asset candidate");
}
});
Unity
Unreal
int assetCandidateID = 12;
bool isCompleted = true;
LootLockerSDKManager.UpdatingAnAssetCandidate(assetCandidateID, isCompleted, (response) =>
{
if (response.success)
{
Debug.Log("Successfully completed asset candidate with ID: " + response.asset_candidate.id);
}
else
{
Debug.Log("Error updating asset candidate");
}
});
The boolean "IsCompleted" should be true to Complete the asset candidate!
Unity
Unreal
int assetCandidateID = 13;
LootLockerSDKManager.DeletingAnAssetCandidate(assetCandidateID, (response) =>
{
if (response.success)
{
Debug.Log("Successfully deleted asset candidate");
}
else
{
Debug.Log("Error deleting asset canddidate");
}
});
Last modified 1mo ago