Work With Triggers in Game
The following tutorial assumes you have already set up your game and made your first API calls. To learn how to do that, visit the Getting Started guide.
Calling this in the game will award the player with any score/XP or assets we set up while create the trigger.
Unity
string triggerName = "test";
LootLockerSDKManager.ExecuteTrigger(triggerName, (response) =>
{
if (response.success)
{
Debug.Log("Successfully triggered event");
}
else
{
Debug.Log("Error triggering event");
}
});
To learn more about the endpoint you can check out our reference documentation on triggering an event
Unity
LootLockerSDKManager.ListExecutedTriggers((response) =>
{
if (response.success)
{
Debug.Log("Successfully retrieved triggered events");
}
else
{
Debug.Log("Error retrieving triggered events");
}
});
Last modified 6mo ago