Advertisement
nio_kasgami

LoadingJSONQuestion

Jul 5th, 2016
85
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.42 KB | None | 0 0
  1. Hi,
  2.  
  3. I'm trying to load a JSON that's make it possible to load via a variable likes this :
  4.  
  5. var SomeJsonData = SomeJSON[id].someParam;
  6. so I already have some Samples codes for the template who look kinda like this :
  7.  
  8. [System.Serializable]
  9. public class Heroes {
  10.  
  11. public static List<this>;
  12. public int id; //
  13. public int classId;
  14. public List<int> equips;
  15. public int initialLevel;
  16. public int maxLevel;
  17. public string name;
  18. public string lastName;
  19. public string profile;
  20. }
  21.  
  22. and my JSON look like this :
  23.  
  24. [
  25. null,
  26. {
  27. "id":1,
  28. "classId":1,
  29. "equips":[],
  30. "initialLevel":1,
  31. "maxLevel": 20,
  32. "name":"Yuu",
  33. "LastName":"Shiki",
  34. "profile":"A young Cleric who got raised by the church of art."
  35. },
  36. {
  37. "id": 2,
  38. "classId": 2,
  39. "equips": [],
  40. "initialLevel":1,
  41. "maxLevel": 20,
  42. "name":"Yuu",
  43. "LastName":"Shiki",
  44. "profile":"A young Cleric who got raised by the church of art."
  45. }
  46. ]
  47. As I know the JSON serializer can't load Array JSON? I was unsure for this....
  48.  
  49. so I don't mind to change a little the structure of my JSON but it's possible to get a way's I can get my JSON data by using the method said above? I know it's not the MOST optimal code but I kinda want to be able to get the data of my Heroes from a id. like TheData[id].SomeParam
  50.  
  51. thanks for your further answer :)
  52.  
  53. Nio Kasgami
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement