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.

Create Asset Candidate

Unity
1
string name = "New Asset Candidate";
2
LootLockerSDKManager.CreatingAnAssetCandidate(name, (response) =>
3
{
4
if (response.success)
5
{
6
Debug.Log("Successfully created asset candidate with ID: " + response.asset_candidate_id);
7
}
8
else
9
{
10
Debug.Log("Error asset candidate");
11
}
12
});
Copied!

Update Asset Candidate

Unity
1
int assetCandidateID = 12;
2
bool isCompleted = false;
3
string name = "new name";
4
LootLockerSDKManager.UpdatingAnAssetCandidate(assetCandidateID, isCompleted, (response) =>
5
{
6
if (response.success)
7
{
8
Debug.Log("Successfully updated asset candidate with ID: " + response.asset_candidate.id);
9
}
10
else
11
{
12
Debug.Log("Error updating asset candidate");
13
}
14
}, name);
Copied!

Add Files To Asset Candidate

Unity
1
int assetCandidateID = 12;
2
string filePath = "Assets/Resources/300.jpg";
3
string fileName = "300.jpg";
4
LootLocker.LootLockerEnums.FilePurpose fileType = LootLocker.LootLockerEnums.FilePurpose.primary_thumbnail;
5
LootLockerSDKManager.AddingFilesToAssetCandidates(assetCandidateID, filePath, fileName, fileType, (response) =>
6
{
7
if (response.success)
8
{
9
Debug.Log("Successfully added image to asset candidate");
10
}
11
else
12
{
13
Debug.Log("Error adding image to asset candidate");
14
}
15
});
Copied!

Complete Asset Candidate

Unity
1
int assetCandidateID = 12;
2
bool isCompleted = true;
3
LootLockerSDKManager.UpdatingAnAssetCandidate(assetCandidateID, isCompleted, (response) =>
4
{
5
if (response.success)
6
{
7
Debug.Log("Successfully completed asset candidate with ID: " + response.asset_candidate.id);
8
}
9
else
10
{
11
Debug.Log("Error updating asset candidate");
12
}
13
});
Copied!

Delete Asset Candidate

Unity
1
int assetCandidateID = 13;
2
LootLockerSDKManager.DeletingAnAssetCandidate(assetCandidateID, (response) =>
3
{
4
if (response.success)
5
{
6
Debug.Log("Successfully deleted asset candidate");
7
}
8
else
9
{
10
Debug.Log("Error deleting asset canddidate");
11
}
12
});
Copied!
Last modified 1mo ago