/// 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);
            });
        }
Example #2
0
        void Start()
        {
            // link components

            label = GetComponent <Text>();

            // find the game clock

            clock = FindObjectOfType <ClockController> ();
        }
Example #3
0
        void Start()
        {
            // link components together

            clock = FindObjectOfType <ClockController> ();
        }
Example #4
0
 void Start()
 {
     clock = FindObjectOfType <ClockController> ();
 }