/// <summary>
        /// Creates the player score panel. This creates a score entry
        /// on the UI for the given player.
        /// </summary>
        /// <param name="playerInfo">Player info.</param>
        internal void CreatePlayerScorePanel(PlayerInfo playerInfo)
        {
            if (scorePanel == null)
            {
                scorePanel = GameObject.Find("Scores");
            }

            if (scorePanel == null)
            {
                Debug.LogError("Score Panel cannot be null!");
                return;
            }

            // use a deterministic name for the panel.
            string panelName = "score" + playerInfo.DeviceId;

            // look for it in the scene.
            GameObject panel = GameObject.Find(panelName);

            // if not there, create it and make it a child object of the
            // score panel.
            if (panel == null)
            {
                panel = Instantiate(scorePrefab) as GameObject;
                panel.transform.SetParent(scorePanel.transform, false);
                panel.name = panelName;

                // associate it with the player info.
                // if there is an old panel there already, destroy it
                if (playerInfo.ScorePanel != null)
                {
                    DestroyObject(playerInfo.ScorePanel);
                }

                playerInfo.ScorePanel = panel;
                playerInfo.ScoreText = null;
                playerInfo.NameText = null;

                // mark the UI for re-laying out the list of scores.
                LayoutRebuilder.MarkLayoutForRebuild(scorePanel.GetComponent<RectTransform>());
            }
            else
            {
                if (playerInfo.ScorePanel != panel)
                {
                    DestroyObject(playerInfo.ScorePanel);
                }

                playerInfo.ScorePanel = panel;
                playerInfo.ScoreText = null;
                playerInfo.NameText = null;
            }

            // Set the text UI objects for easy access.
            if (playerInfo.ScoreText == null || playerInfo.NameText == null)
            {
                Text[] texts = panel.GetComponentsInChildren<Text>();
                if (texts == null)
                {
                    Debug.Log("Found no text components?!?!?!");
                }

                foreach (Text t in texts)
                {
                    if (t.gameObject.name.EndsWith("name"))
                    {
                        playerInfo.NameText = t;
                    }
                    else if (t.gameObject.name.EndsWith("score"))
                    {
                        playerInfo.ScoreText = t;
                    }
                }
            }

            if (playerInfo.NameText == null)
            {
                Debug.Log("Did not find name text field?");
            }

            if (playerInfo.ScoreText == null)
            {
                Debug.Log("Did not find score text field?");
            }

            playerInfo.NameText.text = playerInfo.Player.Name;
            playerInfo.ScoreText.text = Convert.ToString(playerInfo.Score);
        }