Esempio n. 1
0
        private IEnumerator score(int value, Action<ScoreResponse> callback)
        {
            Request r = new Request("game/score");
            r.AddString("score", value.ToString());

            WWW w = runRequest(r);
            yield return w; // wait for response

            ScoreResponse res = new ScoreResponse(processWWWResult(w));
            if (!res.Ready)
            {
                res.ErrorId = ErrorId;
                res.ErrorText = ErrorText;
            }
            else CurrentCheckin = null;

            callback(res);
        }
Esempio n. 2
0
 private void scoreResponse(ScoreResponse res)
 {
     if (res.Ready)
     {
         Debug.Log("SCORE: ok");
         note = string.Format("Time: {0}\nRank: {1}", res.Time, res.Rank);
     }
     else
     {
         Debug.Log("SCORE: " + res.ErrorText + "(" + res.ErrorId + ")");
     }
 }