Пример #1
0
    private void Start()
    {
        this.UpdateAsObservable()
        .Subscribe(_ =>
        {
            _playerInput.InputKeys();
        });

        this.UpdateAsObservable()
        .Subscribe(_ =>
        {
            _playerMover.Move(_playerInput.MoveDirection() * moveSpeed);
        });

        this.UpdateAsObservable()
        .Select(rayHitPosition => _playerRayCaster.GetPositionByRay(_playerInput.LookDirection()))
        .Subscribe(rayHitPosition =>
        {
            _playerRotater.LookRotation(rayHitPosition);
        });

        //攻撃切り替え
        this.UpdateAsObservable()
        .Select(flag => _playerInput.IsAttack())
        .Subscribe(flag =>
        {
            playerAttacker.OnActiveAttackCollider(flag);
        });
    }