示例#1
0
        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);
            }
        }
示例#2
0
        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);
            }
        }
示例#3
0
        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);
            }
        }
示例#4
0
        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);
            }
        }