thieumao

Get All Item Parse.com Unity

Aug 28th, 2015
138
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.76 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.     }
  28.  
  29.     // Update is called once per frame
  30.     void Update()
  31.     {
  32.  
  33.     }
  34. }
Advertisement
Add Comment
Please, Sign In to add comment