|
@@ -96,14 +96,14 @@ namespace KairoEngine.Achievements
|
|
|
}
|
|
|
|
|
|
public void UnlockAchievement(string identifier)
|
|
|
- {
|
|
|
- if(debug) Debug.Log($"Unlocking achievement {identifier}");
|
|
|
+ {
|
|
|
if(library == null) return;
|
|
|
for (int i = 0; i < achievementsStatus.Count; i++)
|
|
|
{
|
|
|
if(achievementsStatus[i].achievement.identifier == identifier)
|
|
|
{
|
|
|
if(achievementsStatus[i].unlocked == true) return;
|
|
|
+ if(debug) Debug.Log($"Unlocking achievement {identifier}");
|
|
|
achievementsStatus[i].unlocked = true;
|
|
|
GenericEvents.Trigger(achievementUnlockedEvent, achievementsStatus[i].achievement.identifier);
|
|
|
PlayerPrefs.SetInt($"ACHIEVEMENT_{achievementsStatus[i].achievement.identifier}", 1);
|
|
@@ -113,13 +113,13 @@ namespace KairoEngine.Achievements
|
|
|
|
|
|
public void LockAchievement(string identifier)
|
|
|
{
|
|
|
- if(debug) Debug.Log($"Locking achievement {identifier}");
|
|
|
if(library == null) return;
|
|
|
for (int i = 0; i < achievementsStatus.Count; i++)
|
|
|
{
|
|
|
if(achievementsStatus[i].achievement.identifier == identifier)
|
|
|
{
|
|
|
if(achievementsStatus[i].unlocked == false) return;
|
|
|
+ if(debug) Debug.Log($"Locking achievement {identifier}");
|
|
|
achievementsStatus[i].unlocked = false;
|
|
|
GenericEvents.Trigger(achievementLockedEvent, achievementsStatus[i].achievement.identifier);
|
|
|
PlayerPrefs.SetInt($"ACHIEVEMENT_{achievementsStatus[i].achievement.identifier}", 0);
|