Example #1
0
        public Guid AddPlayer(ControlScheme controlScheme)
        {
            inputService.AddController(controlScheme);
            var player = playerFactory.Create(controlScheme, playerColors[playerState.players.Count]);

            playerState.players.Add(player);
            return(player.id);
        }
Example #2
0
    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);
    }
Example #3
0
    public void Initialize()
    {
        Player player = _playerFactory.Create(_spawnSettings.startPosition.position);

        _signalBus.Fire(new PlayerSpawnedSignal
        {
            player      = player,
            playerStats = player.BaseStats
        });
    }
Example #4
0
    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;
    }
Example #5
0
    void Awake()
    {
        DOTween.
        SetTweensCapacity(tweenersCapacity: 500, sequencesCapacity: 50);

        PlayerCount = TitleToGameDataSender.PlayerCount;

        for (var i = 1; i <= PlayerCount; i++)
        {
            Players.Add(PlayerFactory.Create(i));
        }
    }
Example #6
0
        public void SpawnPlayer()
        {
            if (_player != null)
            {
                throw new Exception("Нельзя создать еще одного игрока");
            }

            var player = _playerFactory.Create();

            player.transform.position = new Vector3(0, 0.5f, 0);
            _player = player;
        }
Example #7
0
    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);
    }
Example #8
0
    public Player CreatePlayer()
    {
        var player = _playerFactory.Create();

        return(player);
    }
Example #9
0
 private void OnPlayerConnected(NetPeer peer)
 {
     serverState.Players.Add(peer.Id, playerFactory.Create(peer.Id, peer));
 }
Example #10
0
 private void Start()
 {
     _playerFactory.Create();
 }