public static void UpdateCharacterStatistics(string playFabId, string characterId, string key, int value) { var request = new UpdateCharacterStatisticsRequest(); request.CharacterStatistics = new Dictionary <string, int>(); request.PlayFabId = playFabId; request.CharacterId = characterId; request.CharacterStatistics[key] = value; PlayFabServerAPI.UpdateCharacterStatistics(request, UpdateCharacterStatisticsCallback, PfSharedControllerEx.FailCallback("UpdateCharacterStatistics")); }
public static void UpdateCharacterStatistics(string characterId, Dictionary <string, int> updates) { Dictionary <string, int> activeStats; if (!characterStatistics.TryGetValue(characterId, out activeStats)) { return; } ; foreach (var each in updates) { int temp; activeStats.TryGetValue(each.Key, out temp); activeStats[each.Key] = temp + each.Value; } DialogCanvasController.RequestLoadingPrompt(PlayFabAPIMethods.UpdateCharacterStatistics); var request = new UpdateCharacterStatisticsRequest { CharacterId = characterId, CharacterStatistics = activeStats }; PlayFabClientAPI.UpdateCharacterStatistics(request, OnUpdateCharacterStatisticsSuccess, PF_Bridge.PlayFabErrorCallback); }