コード例 #1
0
ファイル: SteamHelper.cs プロジェクト: zerk-js/SOTSII-SOS
 private void AddAchievement(AchievementType cheevo)
 {
     try
     {
         this._steam.SetAchievement(cheevo.ToString());
     }
     catch (Exception ex)
     {
         App.Log.Warn("SetAchievement: " + cheevo.ToString() + " failed.", "steam");
     }
 }
コード例 #2
0
ファイル: SteamHelper.cs プロジェクト: zerk-js/SOTSII-SOS
        private bool HasAchievement(AchievementType cheevo)
        {
            bool flag = false;

            try
            {
                flag = this._steam.GetAchievement(cheevo.ToString());
            }
            catch (Exception ex)
            {
                App.Log.Warn("GetAchievement " + cheevo.ToString() + " failed.", "steam");
            }
            return(flag);
        }
コード例 #3
0
    public void CheckAchievementsByType(AchievementType achievementType)
    {
        List <int> achievementList = new List <int>();

        if (achievementType == AchievementType.PlayerPlayTime)
        {
            achievementList = StoredIDs_PlayerPlayTime;
        }
        else
        {
            achievementList = GetAchievementIDsByType(achievementType);
        }

        float?achievementField = GetAchievementField(achievementType);

        if (achievementField.HasValue)
        {
            foreach (int achievementID in achievementList)
            {
                if (achievementField.Value >= Achievements[achievementID].TargetValue)
                {
                    GameMaster.Instance.Player.UnlockAchievement(achievementID);
                }
            }
        }
        else
        {
            Debug.Log(string.Format("No logic set for achievement type '{0}'!", achievementType.ToString()));
        }
    }
コード例 #4
0
        private AchievementType?AddAchievement(User user, AchievementType achievement)
        {
            if (user.Achievements.Any(x => x.AchievementEnum == (DataAchievementType)achievement))
            {
                return(null);
            }

            user.Achievements.Add(Achievement.Create(achievement.ToString()));

            return(achievement);
        }