Browse Source

Added debugging code

James Peret 2 years ago
parent
commit
c437a468ea
1 changed files with 3 additions and 3 deletions
  1. 3 3
      Runtime/AchievementsController.cs

+ 3 - 3
Runtime/AchievementsController.cs

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