public void UnlockAchievement() { if (!GameServiceManager.IsInitialized()) { MobileNativeUI.Alert("Alert", "You need to initialize the module first."); return; } if (selectedAchievement != null) { GameServiceManager.UnlockAchievement(selectedAchievement.Name); } else { MobileNativeUI.Alert("Alert", "Please select an achievement to unlock."); } }
void OnScoreUpdated(int score) { if (disable) { return; } string acmName = null; foreach (ScoreAchievement acm in achievements) { if (score == acm.scoreToUnlock) { acmName = acm.achievementName; break; } } // Unlock achievement if (acmName != null) { GameServiceManager.UnlockAchievement(acmName); } }