Example #1
0
 public void UnlockAchievement(string achievementName, bool storeStats = false)
 {
     foreach (Achievement achievement in this._achievementList)
     {
         if (achievement.AchievementName == achievementName)
         {
             if (achievement.IsAchieved)
             {
                 break;
             }
             if (this._gameserverStats != IntPtr.Zero)
             {
                 Achievements.SteamUnityAPI_SteamGameServerStats_SetUserAchievement(this._gameserverStats, this._id.ToUInt64(), achievement.AchievementName);
             }
             else
             {
                 Achievements.SteamUnityAPI_SteamUserStats_SetAchievement(this._stats, achievement.AchievementName);
             }
             achievement.IsAchieved = true;
             if (!storeStats)
             {
                 break;
             }
             this.WriteStats();
             break;
         }
     }
 }
Example #2
0
 public void UnlockAchievement(Achievement achievement, bool storeStats)
 {
     if (achievement.IsAchieved)
     {
         return;
     }
     if (this._gameserverStats != IntPtr.Zero)
     {
         Achievements.SteamUnityAPI_SteamGameServerStats_SetUserAchievement(this._gameserverStats, this._id.ToUInt64(), achievement.AchievementName);
     }
     else
     {
         Achievements.SteamUnityAPI_SteamUserStats_SetAchievement(this._stats, achievement.AchievementName);
     }
     achievement.IsAchieved = true;
     if (!storeStats)
     {
         return;
     }
     this.WriteStats();
 }