private void AddAchievement(AchievementType cheevo) { try { this._steam.SetAchievement(cheevo.ToString()); } catch (Exception ex) { App.Log.Warn("SetAchievement: " + cheevo.ToString() + " failed.", "steam"); } }
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); }
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())); } }
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); }