Exemple #1
0
    /// <summary>
    /// Add a ship from the lobby hook
    /// </summary>
    /// <param name="ship">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>
    /// <param name="localID">The localID. e.g. if 2 player are on the same machine this will be 1 & 2</param>
    public static void AddShip(GameObject ship, int playerNum, Color c, string name, int localID)
    {
        NetworkedPlayer tmp = new NetworkedPlayer();
        tmp.m_Instance = ship;
        tmp.m_PlayerNumber = playerNum;
        tmp.m_PlayerColor = c;
        tmp.m_PlayerName = name;
        tmp.m_LocalPlayerID = localID;
        tmp.Setup();

        ServerSettings.players.Add(tmp);
        //m_Ships.Add(tmp);
    }