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)); }
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); }