thieumao

Unity - Parse.com - Get all data

Sep 1st, 2015
127
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.68 KB | None | 0 0
  1. using UnityEngine;
  2. using System.Collections;
  3. using System.Collections.Generic;
  4. using Parse;
  5. using System;
  6. using System.Threading.Tasks;
  7.  
  8. public class Mao : MonoBehaviour
  9. {
  10.  
  11. // Use this for initialization
  12. void Start()
  13. {
  14. var query = ParseObject.GetQuery("GameScore").OrderBy("score").Limit(10);
  15. query.FindAsync().ContinueWith(t =>
  16. {
  17. IEnumerable<ParseObject> results = t.Result;
  18. foreach (var obj in results)
  19. {
  20. //var score = obj.Get<ParseObject>("score");
  21. var score = obj.Get<float>("score");
  22. Debug.Log("Score: " + score);
  23. }
  24. });
  25.  
  26.  
  27. }
Advertisement
Add Comment
Please, Sign In to add comment