コード例 #1
0
ファイル: GameManager.cs プロジェクト: IgorCH/_UNETMD
		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);
		}
コード例 #2
0
ファイル: GameManager.cs プロジェクト: IgorCH/_UNETMD
		//[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);
	    }