private static void fillList(JSONNode d, RankingObservableObject allUsers) { for (int i = 0; i < d.Count; i++) { RankingUser newUser = new RankingUser(); newUser.setScore(d[i][5]); newUser.setUser(d[i][2]); allUsers.addUser(newUser); } allUsers.filled(); }
public static IEnumerator getScores(string levelId, RankingObservableObject allUsers) { WWW www = new WWW("http://pixelder.com/api/smart/api.php/score?filter=levelid,eq," + levelId); yield return(www); if (!string.IsNullOrEmpty(www.error)) { print(www.error); } else { var d = JSON.Parse(www.text)["score"]["records"]; fillList(d, allUsers); } }