Example #1
0
        protected internal override void Deserialize(BinaryReader br)
        {
            CarId   = br.ReadByte();
            LapTime = br.ReadUInt32();
            Cuts    = br.ReadByte();

            var leaderboardCount = br.ReadByte();

            Leaderboard.Clear();
            for (int i = 0; i < leaderboardCount; i++)
            {
                Leaderboard.Add(MsgLapCompletedLeaderboardEnty.FromBinaryReader(br));
            }

            GripLevel = br.ReadSingle();
        }
    private void OnGUI()
    {
        GUI.skin    = LeaderboardSkin;
        _scoreInput = GameControl.control.playerscore;

        GUILayout.BeginArea(new Rect(480, 0, 960, Screen.height));

        GUILayout.Label("High Scores", HeaderStyle); // Display the header
        GUILayout.Space(20);

        // Display high scores!
        for (int i = 0; i < Leaderboard.EntryCount; ++i)
        {
            var entry = Leaderboard.GetEntry(i);
            GUILayout.Label("Name: " + entry.name + ", Score: " + entry.score);
        }

        // Interface for reporting test scores.
        GUILayout.Space(10);

        _nameInput = GUILayout.TextField(_nameInput);
        //_scoreInput = GUILayout.TextField(_scoreInput);
        GUILayout.Label("Current Score:  " + _scoreInput.ToString(), ScoreStyle);

        if (GUILayout.Button("Record"))
        {
            int score;
            int.TryParse(_scoreInput.ToString(), out score);

            Leaderboard.Record(_nameInput, score);

            // Reset for next input.
            _nameInput  = "Name Input";
            _scoreInput = GameControl.control.playerscore;
        }

        if (GUILayout.Button("Clear"))
        {
            Leaderboard.Clear();
        }

        GUILayout.EndArea();
    }
Example #3
0
 public void clearLeaderboard()
 {
     Leaderboard.Clear();
 }
Example #4
0
 public void LeaderboardClear()
 {
     Leaderboard.Clear();
     LeaderboardMenuUpdate();
 }
Example #5
0
 static void ClearScore()
 {
     Leaderboard.Clear();
 }