private void OnCharacter(MessageCharacter data)
        {
            int ndx = data.id;

            if (ndx < 0 || ndx >= characterPrefabs.Length)
            {
                Debug.LogError("invalid charater selection: " + ndx);
                return;
            }

            // The ExampleCharacterSelect GameObject no longer
            // needs to care about m_netPlayer
            m_netPlayer.OnDisconnect -= Remove;
            m_netPlayer.UnregisterCmdHandler("character");

            // Create the character
            GameObject newGameObject = (GameObject)Instantiate(characterPrefabs[ndx]);

            // Send the netplayer to the character. We use a message
            // because then every character can have a differnet script if we want.
            newGameObject.SendMessage("InitializeFromCharacterSelect", new StartInfo(m_netPlayer, m_playerNameManager));

            // We're done. Destory ourselves
            Destroy(gameObject);
        }
        private void OnCharacter(MessageCharacter data)
        {
            int ndx = data.id;
            if (ndx < 0 || ndx >= characterPrefabs.Length) {
            Debug.LogError("invalid charater selection: " + ndx);
            return;
            }

            // The ExampleCharacterSelect GameObject no longer
            // needs to care about m_netPlayer
            m_netPlayer.OnDisconnect -= Remove;
            m_netPlayer.UnregisterCmdHandler("character");

            // Create the character
            GameObject newGameObject = (GameObject)Instantiate(characterPrefabs[ndx]);
            // Send the netplayer to the character. We use a message
            // because then every character can have a differnet script if we want.
            newGameObject.SendMessage("InitializeFromCharacterSelect", new StartInfo(m_netPlayer, m_playerNameManager));

            // We're done. Destory ourselves
            Destroy(gameObject);
        }