示例#1
0
    void Start()
    {
        PostGameInfo pgi = GameObject.FindObjectOfType <PostGameInfo> ();

        textbox.text = "";

        foreach (KeyValuePair <string, int> entry in pgi.playerScores)
        {
            textbox.text += entry.Value.ToString();
            textbox.text += "\t";
            textbox.text += entry.Key;
            textbox.text += System.Environment.NewLine;
        }

        pgi.Cleanup();
    }
示例#2
0
        private void r_CurrentGame_GameEnded(PostGameInfo i_PostGameInfo)
        {
            string endOfTheGameAnnouncement = "The game ended in a draw!";

            if (i_PostGameInfo.IsADraw == false)
            {
                string winnerName = i_PostGameInfo.Winner.IsComputer() == true ? "Computer" : i_PostGameInfo.Winner.Name;
                endOfTheGameAnnouncement = string.Format(
                    "{0} has won with a score of {1}",
                    winnerName,
                    i_PostGameInfo.Winner.Score);
            }

            MessageBox.Show(endOfTheGameAnnouncement, "Memory Game - Result", MessageBoxButtons.OK, MessageBoxIcon.Information);

            this.DialogResult = DialogResult.OK;
            this.Close();
        }
示例#3
0
 void Start()
 {
     pgi = GameObject.FindObjectOfType <PostGameInfo> ();
 }