예제 #1
0
    // Summary:
    // Provides movement vectors based on 2-Dimensional keyboard movement normalised before processing.
    // Movement vectors provided are the net directions relative to a fixed center.
    private void OnMovement(InputValue value)
    {
        if (pauseChecker.CheckIsPaused())
        {
            return;
        }

        playerMovement.SetTriggerIsHeld(value.Get <Vector2>() != Vector2.zero);
        currentMousePosition = value.Get <Vector2>();
        playerMovement.CalculateMovement(centerPosition, currentMousePosition);
    }
예제 #2
0
        private void FixedUpdate()
        {
            if (pauseChecker.CheckIsPaused())
            {
                return;
            }
            if (loadoutPosition == LoadoutConfiguration.Pivot)
            {
                RotatePivotWeapons();
            }
            if (!isFiring)
            {
                return;
            }

            FireWeapons();
        }
예제 #3
0
    /// <summary>
    /// Processes all touch input coming through the input system.
    /// </summary>
    private void ProcessTouchInput()
    {
        if (!pauseChecker.CheckIsPaused())
        {
            activeTouches = UnityEngine.InputSystem.EnhancedTouch.Touch.activeTouches;

            if (activeTouches.Count > 0)
            {
                for (var i = 0; i < activeTouches.Count; i++)
                {
                    OnJoyStickControl(activeTouches[i]);
                }
            }
        }
        else
        {
            joystick.HidePad();
        }
    }
예제 #4
0
        private void FixedUpdate()
        {
            if (pauseChecker.CheckIsPaused())
            {
                playerRB.velocity = Vector2.zero;
                return;
            }

            if (!ValidateRequirements())
            {
                return;
            }
            if (isMovementLocked)
            {
                return;
            }

            RunMovement();
            RunRotation();
        }