示例#1
0
        /// submit a score to the leaderboards,
        /// updating the client on a response
        static void SubmitScore(float time)
        {
            // The Leaderboards to submit our time to
            Leaderboards leaderboards = new Leaderboards();

            // The score to submit
            string ourName      = GamerTagManager.GetGamerTag();
            string theirName    = MultiPlayerController.Instance.theirName;
            int    tenthSeconds = ClockController.SecondsToTenthsOfSeconds(time);
            Score  score        = new Score(tenthSeconds, ourName, theirName);

            // Submit the time the the leaderboards, and send a message
            // to the client upon response
            leaderboards.SubmitScoreAsync(SceneManager.opts.level, score,
                                          delegate(SubmissionResponse r, ServerException e) {
                if (e != null)
                {
                    UILogger.Log(e.Message);
                }
                position    = (byte)r.position;
                positionSet = true;

                updateManager.SendLeaderboardsUpdate(position);
            });
        }
示例#2
0
 static UILogger getInstance()
 {
     if (instance == null)
     {
         instance = (UILogger)GameObject.FindObjectOfType(typeof(UILogger));
         if (instance == null)
         {
             GameObject go = new GameObject("UILogger");
             instance = go.AddComponent <UILogger>();
         }
     }
     return(instance);
 }