@@ -54,31 +54,31 @@ void Start()
54
54
* LootLocker will create an identifier for the user and store it in PlayerPrefs.
55
55
* If you want to create a new player when testing, you can use PlayerPrefs.DeleteKey("LootLockerGuestPlayerID");
56
56
*/
57
- LootLockerSDKManager . StartGuestSession ( ( response ) =>
57
+ LootLockerSDKManager . StartGuestSession ( ( startGuestSessionResponse ) =>
58
58
{
59
- if ( response . success )
59
+ if ( startGuestSessionResponse . success )
60
60
{
61
61
// Register the progression to the player; this will create the progression if it doesn't already exist.
62
62
// It is the same as adding 0 to the progression.
63
- LootLockerSDKManager . RegisterPlayerProgression ( progressionKey1 , ( response ) =>
63
+ LootLockerSDKManager . RegisterPlayerProgression ( progressionKey1 , ( registerPlayerProgressionResponse ) =>
64
64
{
65
- if ( response . success )
65
+ if ( registerPlayerProgressionResponse . success )
66
66
{
67
67
Debug . Log ( "Progression registered" ) ;
68
- UpdateProgressionUI1 ( response . step , response . points , response . previous_threshold , response . next_threshold ) ;
68
+ UpdateProgressionUI1 ( registerPlayerProgressionResponse . step , registerPlayerProgressionResponse . points , registerPlayerProgressionResponse . previous_threshold , registerPlayerProgressionResponse . next_threshold ) ;
69
69
}
70
70
else
71
71
{
72
72
Debug . Log ( "Error registering progression" ) ;
73
73
}
74
74
} ) ;
75
75
// Same with progression 2
76
- LootLockerSDKManager . RegisterPlayerProgression ( progressionKey2 , ( response ) =>
76
+ LootLockerSDKManager . RegisterPlayerProgression ( progressionKey2 , ( registerPlayerProgressionResponse ) =>
77
77
{
78
- if ( response . success )
78
+ if ( registerPlayerProgressionResponse . success )
79
79
{
80
80
Debug . Log ( "Progression registered" ) ;
81
- UpdateProgressionUI2 ( response . step , response . points , response . previous_threshold , response . next_threshold ) ;
81
+ UpdateProgressionUI2 ( registerPlayerProgressionResponse . step , registerPlayerProgressionResponse . points , registerPlayerProgressionResponse . previous_threshold , registerPlayerProgressionResponse . next_threshold ) ;
82
82
}
83
83
else
84
84
{
@@ -110,21 +110,21 @@ public void AddPointsToProgression1()
110
110
// Add X amount of points to the progression
111
111
// All progressions uses ulong as the type for the points, so you need to cast the value to ulong.
112
112
// Progressions will not be able to go below 0 (no negative progressions).
113
- LootLockerSDKManager . AddPointsToPlayerProgression ( progressionKey1 , ( ulong ) pointsAmountSlider1 . value , ( response ) =>
113
+ LootLockerSDKManager . AddPointsToPlayerProgression ( progressionKey1 , ( ulong ) pointsAmountSlider1 . value , ( addPointsToPlayerProgressionResponse ) =>
114
114
{
115
- if ( response . success )
115
+ if ( addPointsToPlayerProgressionResponse . success )
116
116
{
117
117
Debug . Log ( "Points added to progression" ) ;
118
118
// If the player leveled up, the count of awarded_tiers will be greater than 0
119
- UpdateProgressionUI1 ( response . step , response . points , response . previous_threshold , response . next_threshold ) ;
119
+ UpdateProgressionUI1 ( addPointsToPlayerProgressionResponse . step , addPointsToPlayerProgressionResponse . points , addPointsToPlayerProgressionResponse . previous_threshold , addPointsToPlayerProgressionResponse . next_threshold ) ;
120
120
121
121
// Update both progressions
122
- LootLockerSDKManager . GetPlayerProgressions ( ( response ) =>
122
+ LootLockerSDKManager . GetPlayerProgressions ( ( getPlayerProgressionsResponse ) =>
123
123
{
124
- if ( response . success )
124
+ if ( getPlayerProgressionsResponse . success )
125
125
{
126
- var progression1 = response . items . Find ( x => x . progression_key == progressionKey1 ) ;
127
- var progression2 = response . items . Find ( x => x . progression_key == progressionKey2 ) ;
126
+ var progression1 = getPlayerProgressionsResponse . items . Find ( x => x . progression_key == progressionKey1 ) ;
127
+ var progression2 = getPlayerProgressionsResponse . items . Find ( x => x . progression_key == progressionKey2 ) ;
128
128
UpdateProgressionUI1 ( progression1 . step , progression1 . points , progression1 . previous_threshold , progression1 . next_threshold ) ;
129
129
UpdateProgressionUI2 ( progression2 . step , progression2 . points , progression2 . previous_threshold , progression2 . next_threshold ) ;
130
130
}
@@ -141,32 +141,32 @@ public void AddPointsToProgression2()
141
141
// Add X amount of points to the progression
142
142
// All progressions uses ulong as the type for the points, so you need to cast the value to ulong.
143
143
// Progressions will not be able to go below 0 (no negative progressions).
144
- LootLockerSDKManager . AddPointsToPlayerProgression ( progressionKey2 , ( ulong ) pointsAmountSlider2 . value , ( response ) =>
144
+ LootLockerSDKManager . AddPointsToPlayerProgression ( progressionKey2 , ( ulong ) pointsAmountSlider2 . value , ( addPointsToPlayerProgressionResponse ) =>
145
145
{
146
- if ( response . success )
146
+ if ( addPointsToPlayerProgressionResponse . success )
147
147
{
148
148
Debug . Log ( "Points added to progression" ) ;
149
149
150
150
// If the player leveled up, the count of awarded_tiers will be greater than 0
151
- if ( response . awarded_tiers . Count > 0 )
151
+ if ( addPointsToPlayerProgressionResponse . awarded_tiers . Count > 0 )
152
152
{
153
153
Debug . Log ( "Player leveled up" ) ;
154
154
}
155
155
156
- UpdateProgressionUI2 ( response . step , response . points , response . previous_threshold , response . next_threshold ) ;
156
+ UpdateProgressionUI2 ( addPointsToPlayerProgressionResponse . step , addPointsToPlayerProgressionResponse . points , addPointsToPlayerProgressionResponse . previous_threshold , addPointsToPlayerProgressionResponse . next_threshold ) ;
157
157
158
158
// Since progression 1 is connected to progression 2, we need to update it as well
159
- LootLockerSDKManager . GetPlayerProgression ( progressionKey1 , ( response ) =>
159
+ LootLockerSDKManager . GetPlayerProgression ( progressionKey1 , ( getPlayerProgressionResponse ) =>
160
160
{
161
- if ( response . success )
161
+ if ( getPlayerProgressionResponse . success )
162
162
{
163
163
/*
164
- * response .step is the current tier of the progression
165
- * response .points is the current amount of points taht the player has in the progression
166
- * response .previous_threshold is the amount of points needed to reach the previous tier
167
- * response .next_threshold is the amount of points needed to reach the next tier
164
+ * getPlayerProgressionResponse .step is the current tier of the progression
165
+ * getPlayerProgressionResponse .points is the current amount of points taht the player has in the progression
166
+ * getPlayerProgressionResponse .previous_threshold is the amount of points needed to reach the previous tier
167
+ * getPlayerProgressionResponse .next_threshold is the amount of points needed to reach the next tier
168
168
* */
169
- UpdateProgressionUI1 ( response . step , response . points , response . previous_threshold , response . next_threshold ) ;
169
+ UpdateProgressionUI1 ( getPlayerProgressionResponse . step , getPlayerProgressionResponse . points , getPlayerProgressionResponse . previous_threshold , getPlayerProgressionResponse . next_threshold ) ;
170
170
}
171
171
else
172
172
{
@@ -184,12 +184,12 @@ public void AddPointsToProgression2()
184
184
public void ResetProgression1 ( )
185
185
{
186
186
// Reset the progression to 0
187
- LootLockerSDKManager . ResetPlayerProgression ( progressionKey1 , ( response ) =>
187
+ LootLockerSDKManager . ResetPlayerProgression ( progressionKey1 , ( resetPlayerProgressionResponse ) =>
188
188
{
189
- if ( response . success )
189
+ if ( resetPlayerProgressionResponse . success )
190
190
{
191
191
Debug . Log ( "Progression reset" ) ;
192
- UpdateProgressionUI1 ( response . step , response . points , response . previous_threshold , response . next_threshold ) ;
192
+ UpdateProgressionUI1 ( resetPlayerProgressionResponse . step , resetPlayerProgressionResponse . points , resetPlayerProgressionResponse . previous_threshold , resetPlayerProgressionResponse . next_threshold ) ;
193
193
}
194
194
else
195
195
{
@@ -201,12 +201,12 @@ public void ResetProgression1()
201
201
public void ResetProgression2 ( )
202
202
{
203
203
// Reset the progression to 0
204
- LootLockerSDKManager . ResetPlayerProgression ( progressionKey2 , ( response ) =>
204
+ LootLockerSDKManager . ResetPlayerProgression ( progressionKey2 , ( resetPlayerProgressionResponse ) =>
205
205
{
206
- if ( response . success )
206
+ if ( resetPlayerProgressionResponse . success )
207
207
{
208
208
Debug . Log ( "Progression reset" ) ;
209
- UpdateProgressionUI2 ( response . step , response . points , response . previous_threshold , response . next_threshold ) ;
209
+ UpdateProgressionUI2 ( resetPlayerProgressionResponse . step , resetPlayerProgressionResponse . points , resetPlayerProgressionResponse . previous_threshold , resetPlayerProgressionResponse . next_threshold ) ;
210
210
}
211
211
else
212
212
{
0 commit comments