示例#1
0
    private void ReadHitDirection()
    {
        if (_hitMethod == null)
        {
            return;
        }

        var hittingStraight = _actionMapper.GetForward();
        var hittingDropshot = _actionMapper.GetBackward();
        var hittingLeft     = _actionMapper.GetLeft();
        var hittingRight    = _actionMapper.GetRight();

        if (hittingStraight) // Vertical input resets horizontal input
        {
            _hitDirectionVert  = HitDirectionVertical.Deep;
            _hitDirectionHoriz = HitDirectionHorizontal.Center;
        }
        else if (hittingDropshot)
        {
            _hitDirectionVert  = HitDirectionVertical.Dropshot;
            _hitDirectionHoriz = HitDirectionHorizontal.Center;
        }

        if (hittingLeft)
        {
            _hitDirectionHoriz = HitDirectionHorizontal.Left;
        }
        else if (hittingRight)
        {
            _hitDirectionHoriz = HitDirectionHorizontal.Right;
        }
    }