Skip to content

Commit 7cb38cd

Browse files
JohannesLootkirre-bylund
authored andcommitted
Added example of when a player levels up, removed some comments
1 parent 442ebc9 commit 7cb38cd

File tree

2 files changed

+8
-7
lines changed

2 files changed

+8
-7
lines changed

Samples~/LootLockerExamples/Scripts/LootLockerLevelProgression.cs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -131,10 +131,8 @@ public void ResetProgression()
131131
});
132132
}
133133

134-
void UpdateProgressionUI(ulong currentTier, ulong currentPoints, ulong previousTierPoints, ulong? nextTierPoints, bool leveledUp = false)
134+
void UpdateProgressionUI(ulong currentTier, ulong currentPoints, ulong previousTierPoints, ulong? nextTierPoints)
135135
{
136-
// Do something with leveled up, shoiw text or such?
137-
138136
// Update the UI with the progression information
139137
currentTierText.text = "Current tier: " + currentTier;
140138

Samples~/LootLockerExamples/Scripts/LootLockerMultipleProgressions.cs

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -146,11 +146,16 @@ public void AddPointsToProgression2()
146146
if (response.success)
147147
{
148148
Debug.Log("Points added to progression");
149+
149150
// If the player leveled up, the count of awarded_tiers will be greater than 0
151+
if (response.awarded_tiers.Count > 0)
152+
{
153+
Debug.Log("Player leveled up");
154+
}
155+
150156
UpdateProgressionUI2(response.step, response.points, response.previous_threshold, response.next_threshold);
151157

152158
// Since progression 1 is connected to progression 2, we need to update it as well
153-
// Since progression 2 is connected to progression 1, we need to update it as well
154159
LootLockerSDKManager.GetPlayerProgression(progressionKey1, (response) =>
155160
{
156161
if (response.success)
@@ -236,10 +241,8 @@ void UpdateProgressionUI1(ulong currentTier, ulong currentPoints, ulong previous
236241
currentPointsText1.text = "Current points: " + currentPoints;
237242
}
238243

239-
void UpdateProgressionUI2(ulong currentTier, ulong currentPoints, ulong previousTierPoints, ulong? nextTierPoints, bool leveledUp = false)
244+
void UpdateProgressionUI2(ulong currentTier, ulong currentPoints, ulong previousTierPoints, ulong? nextTierPoints)
240245
{
241-
// Do something with leveled up, shoiw text or such?
242-
243246
// Update the UI with the progression information
244247
currentTierText2.text = "Current tier: " + currentTier;
245248

0 commit comments

Comments
 (0)