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.

Create Asset Candidate

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");
    }
});

Update Asset Candidate

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);

Add Files To Asset Candidate

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");
    }
});

Removing Files From Asset Candidate

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");
    }
});

Complete Asset Candidate

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");
    }
});

Delete Asset Candidate

int assetCandidateID = 13;
LootLockerSDKManager.DeletingAnAssetCandidate(assetCandidateID, (response) =>
{
    if (response.success)
    {
        Debug.Log("Successfully deleted asset candidate");
    }
    else
    {
        Debug.Log("Error deleting asset canddidate");
    }
});

Last updated