static public void AddBot() { CharacterManager tmp = new CharacterManager(); //GameObject создаем здесь //tmp.Instance = character; //номер выдаем пока рандомный //tmp.PlayerNumber = playerNum; //цвет выдаем пока рандомный //tmp.PlayerColor = c; tmp.PlayerName = "Bot"; tmp.Setup(); Characters.Add(tmp); }
private IEnumerator RoundEnding() { // Clear the winner from the previous round. _roundWinner = null; // See if there is a winner now the round is over. _roundWinner = GetRoundWinner(); // If there is a winner, increment their score. if (_roundWinner != null) _roundWinner.m_Wins++; // Now the winner's score has been incremented, see if someone has one the game. _gameWinner = GetGameWinner(); RpcUpdateMessage(EndMessage(0)); //notify client they should disable tank control RpcRoundEnding(); // Wait for the specified length of time until yielding control back to the game loop. yield return _endWait; }
//[ClientRpc] //public void RpcPrepareClients() //{ //Debug.Log(GameObject.FindGameObjectsWithTag("SpawnPoint")); //SpawnPoints = GameObject.FindGameObjectsWithTag ("SpawnPoint"); //} /// <summary> /// Add a character from the lobby hook /// </summary> /// <param name="tank">The actual GameObject instantiated by the lobby, which is a NetworkBehaviour</param> /// <param name="playerNum">The number of the player (based on their slot position in the lobby)</param> /// <param name="c">The color of the player, choosen in the lobby</param> /// <param name="name">The name of the Player, choosen in the lobby</param> static public void AddCharacter(GameObject character, int playerNum, Color c, string name) { CharacterManager tmp = new CharacterManager(); tmp.Instance = character; tmp.PlayerNumber = playerNum; tmp.PlayerColor = c; tmp.PlayerName = name; tmp.Setup(); Characters.Add(tmp); }