Exemplo n.º 1
0
        public override void OnStartClient()
        {
            base.OnStartClient();
            if (!isServer)
            {
                NetworkGameManager.AddPlayer(gameObject, playerNumber, color, playerName);
            }

            GameObject m_TankRenderers = transform.Find("TankRenderers").gameObject;

            // Get all of the renderers of the tank.
            Renderer[] renderers = m_TankRenderers.GetComponentsInChildren <Renderer>();

            // Go through all the renderers...
            for (int i = 0; i < renderers.Length; i++)
            {
                // ... set their material color to the color specific to this tank.
                renderers[i].material.color = color;
            }

            if (m_TankRenderers)
            {
                m_TankRenderers.SetActive(false);
            }
            nameTag.text = "<color=#" + ColorUtility.ToHtmlStringRGB(color) + ">" + playerName + "</color>";
        }
Exemplo n.º 2
0
        public override void OnLobbyServerSceneLoadedForPlayer(NetworkManager manager, GameObject lobbyPlayer, GameObject gamePlayer)
        {
            if (lobbyPlayer == null)
            {
                return;
            }

            Prototype.NetworkLobby.LobbyPlayer lp = lobbyPlayer.GetComponent <Prototype.NetworkLobby.LobbyPlayer>();

            if (lp != null)
            {
                NetworkGameManager.AddPlayer(gamePlayer, lp.slot, lp.playerColor, lp.nameInput.text);
            }
        }
Exemplo n.º 3
0
        private NetworkTankManager m_GameWinner;    // Reference to the winner of the game.  Used to make an announcement of who won.


        /// <summary>
        /// Singleton, set the instance
        /// </summary>
        void Awake()
        {
            INSTANCE = this;
        }