public CharacterController(TopDownMovementModel movementModel, CharacterView view)
        {
            _movementModel = movementModel;
            _view          = view;

            _movementModel.Position.Subscribe(pos => { _view.Position = pos; });
        }
Пример #2
0
        IEnumerator Start()
        {
            int playerId = 1;

            foreach (var devicePrefix in _deviceInputPrefix)
            {
                IGameInputProvider gameInputProvider = new PlayerInputProvider(devicePrefix);
                var topDownMovement = new TopDownMovementModel(gameInputProvider, playerId);
                var view            = Instantiate(_characterView);
                var charController  = new CharacterController(topDownMovement, view);

                playerId++;
            }


            _waitForEndOfFrame = new WaitForEndOfFrame();
            yield return(_waitForEndOfFrame);
        }