Hi All,
I was testing unicorn battle project to understand the workflow of GetTitleData. I was successfully receiving all of the data in json format except the one which I added as "QuizData", this key is also in json and I am sure about that . Please see the following code and help me or give me some other sample code.
******************************************************************
public static Dictionary<string, Data> LevelData = new Dictionary<string, Data>();
public static void GetTitleData()
{ GetTitleDataRequest request = new GetTitleDataRequest() {
Keys = new List<string>() { "Classes", "Spells", "StartingCharacterSlots", "MinimumInterstitialWait", "CharacterLevelRamp", "Levels", "Achievements", "Sales", "Events", "Offers", "CommunityWebsite", "StandardStores","QuizData"}
};
DialogCanvasController.RequestLoadingPrompt(PlayFabAPIMethods.GetTitleData); PlayFabClientAPI.GetTitleData(request, OnGetTitleDataSuccess, PF_Bridge.PlayFabErrorCallback); }
public static void OnGetTitleDataSuccess(GetTitleDataResult result) {
Debug.Log("length "+result.Data.Count); // return 12, it should return 13
if(result.Data.ContainsKey("Classes"))
{ Spells = PlayFab.SimpleJson.DeserializeObject<Dictionary<string, UB_SpellDetail>>(result.Data["Spells"]); } if (result.Data.ContainsKey("QuizData")) { LevelData= PlayFab.SimpleJson.DeserializeObject<Dictionary<string, Data>>(result.Data["QuizData"]); Debug.Log("LevelDataCount " + LevelData.Count); }
}
********************************************************************
[System.Serializable] public class Data
{ int level { get; set; } int firstOperand { get; set; } int secondOperand { get; set; } string operation { get; set; }
Data() {}
Data(Data d) { if (d != null) { level = d.level; firstOperand = d.firstOperand; secondOperand = d.secondOperand; operation = d.operation;
}
}
}