public void EnemyKillAchievements(int _id, int _enemyKilled) { if (_enemyKilled >= enemyKillMark[killProgress]) { GameApplication.Instance.GetService <IPlayerSaveService>().SetAchievementStatus(AchievementTypes.ENEMYKILLS, _id, 1); killProgress++; } AchievementStatus currentStatus = GameApplication.Instance.GetService <IPlayerSaveService>().GetAchievementStatus(AchievementTypes.ENEMYKILLS, _id); if (currentStatus == AchievementStatus.FINISHED) { OnAchievementCrossed.Invoke("Achievement Unlocked for player" + _id.ToString() + "Kill " + enemyKillMark.ToString() + " Enemies!!"); UnlockReward.Invoke(idToUnlock, _type); } }
public void GamePlayedAchievements(int _id, int _gamesPlayed) { idToUnlock = 4; if (_gamesPlayed >= gamePlayedMark[gamePlayedProgress]) { GameApplication.Instance.GetService <IPlayerSaveService>().SetAchievementStatus(AchievementTypes.GAMESJOINED, _id, 1); gamePlayedProgress++; } AchievementStatus currentStatus = GameApplication.Instance.GetService <IPlayerSaveService>().GetAchievementStatus(AchievementTypes.GAMESJOINED, _id); if (currentStatus == AchievementStatus.FINISHED) { OnAchievementCrossed.Invoke("Achievement Unlocked for player" + _id.ToString() + "Play " + gamePlayedMark.ToString() + " Games!!"); UnlockReward?.Invoke(idToUnlock, _type); } }
public void HighScoreAchievements(int _id, int _highScore) { idToUnlock = 3; if (_highScore >= highScoreMark[highScoreProgress]) { GameApplication.Instance.GetService <IPlayerSaveService>().SetAchievementStatus(AchievementTypes.HIGHSCORE, _id, 1); highScoreProgress++; } AchievementStatus currentStatus = GameApplication.Instance.GetService <IPlayerSaveService>().GetAchievementStatus(AchievementTypes.HIGHSCORE, _id); if (currentStatus == AchievementStatus.FINISHED) { OnAchievementCrossed.Invoke("Achievement Unlocked for player" + _id.ToString() + "Reach HighScore " + highScoreMark.ToString() + "!!"); UnlockReward.Invoke(idToUnlock, _type); } }
public void DieAchievements(int _id, int _dieCalled) { idToUnlock = 1; if (_dieCalled >= dieMark[dieProgress]) { GameApplication.Instance.GetService <IPlayerSaveService>().SetAchievementStatus(AchievementTypes.PLAYERDEATHS, _id, 1); dieProgress++; } AchievementStatus currentStatus = GameApplication.Instance.GetService <IPlayerSaveService>().GetAchievementStatus(AchievementTypes.PLAYERDEATHS, _id); if (currentStatus == AchievementStatus.FINISHED) { OnAchievementCrossed.Invoke("Achievement Unlocked for player" + _id.ToString() + " Die " + dieMark.ToString() + " times"); UnlockReward.Invoke(idToUnlock, _type); } }