public Guid AddPlayer(ControlScheme controlScheme) { inputService.AddController(controlScheme); var player = playerFactory.Create(controlScheme, playerColors[playerState.players.Count]); playerState.players.Add(player); return(player.id); }
private IPlayer SpawnPlayer(Vector3 position, Quaternion rotation, Player.Types type, UIPlayerPanel panel) { var player = _playerFactory.Create() as IPlayer; player.Reset(position, rotation, type, panel, _aiModel); return(player); }
public void Initialize() { Player player = _playerFactory.Create(_spawnSettings.startPosition.position); _signalBus.Fire(new PlayerSpawnedSignal { player = player, playerStats = player.BaseStats }); }
private void HandleReady(int id, NetworkData data) { var readyData = JsonConvert.DeserializeObject <ReadyData>(data.Data); var oldPlayer = serverState.Players[id]; var player = playerFactory.Create(id, oldPlayer.Peer); player.Ready = readyData.Ready; serverState.Players[id] = player; }
void Awake() { DOTween. SetTweensCapacity(tweenersCapacity: 500, sequencesCapacity: 50); PlayerCount = TitleToGameDataSender.PlayerCount; for (var i = 1; i <= PlayerCount; i++) { Players.Add(PlayerFactory.Create(i)); } }
public void SpawnPlayer() { if (_player != null) { throw new Exception("Нельзя создать еще одного игрока"); } var player = _playerFactory.Create(); player.transform.position = new Vector3(0, 0.5f, 0); _player = player; }
public void StartNewGame() { _players = new List <Player>(); for (int i = 1; i <= _gameConfig.playersCount; i++) { Player player = _playerFactory.Create(i); _players.Add(player); } SpawnSpies(); _activePlayer = _players[0]; _windowsManager.Hide <StartWindow>(); _windowsManager.Show <PlayerWindow>(_activePlayer); }
public Player CreatePlayer() { var player = _playerFactory.Create(); return(player); }
private void OnPlayerConnected(NetPeer peer) { serverState.Players.Add(peer.Id, playerFactory.Create(peer.Id, peer)); }
private void Start() { _playerFactory.Create(); }