Manage UGC from Game
If you wanna learn more about what you can use User Generated Content for in your game, read our background page on Backend Systems
User Generated Content is internally called Asset Candidates. Before it's turned into actual assets in your game, it first needs to be created and completed by the player.
If you have moderation enabled, the Asset Candidate also needs to be approved before it shows up as an asset.
Unity
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
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);
Unity
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
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");
}
});
Unity
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 4mo ago