コード例 #1
0
ファイル: GameClient.cs プロジェクト: mikeries/Empire
        internal Task UpdatePlayerStatus(PlayerData.PlayerStatus playerStatus)
        {
            PlayerData playerData = null;

            if (_playerList.ContainsKey(LocalPlayerID))
            {
                playerData = _playerList[LocalPlayerID];
            }
            else
            {
                playerData = new PlayerData(new Player(LocalPlayerID), _myAddress, _myPort);
            }
            playerData.Status = playerStatus;
            return(SendPacketToHost(playerData));
        }
コード例 #2
0
ファイル: Host.cs プロジェクト: dupperT/TCP_Network
    void AddPlayer(float Horizontal, float Vertical, int connectionID, GameObject PlayerOBJ, PlayerData.PlayerStatus playerStatus)
    {
        PlayerData playerData = new PlayerData
        {
            Vertical     = Horizontal,
            Horizontal   = Vertical,
            connectionId = connectionID,
            PlayerOBJ    = Instantiate(PlayerOBJ),
            playerStatus = PlayerData.PlayerStatus.Connected
        };

        Players.Add(playerData);
    }