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(); }
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(); }
void Start() { pgi = GameObject.FindObjectOfType <PostGameInfo> (); }