Esempio n. 1
0
    // Update is called once per frame
    void Update()
    {
        if (!isLocalPlayer)
        {
            return;
        }
        float hMove = USACPI.GetAxis("Horizontal") * hSpeed;
        float vMove = USACPI.GetAxis("Vertical") * vSpeed;

        transform.Translate(new Vector3(hMove, 0f, vMove));
    }
Esempio n. 2
0
    void VerticalRotation()
    {
        float rotationFactor = InputManager.GetAxis(verticalAxisName);

        rotationFactor *= Time.deltaTime * rotationSpeed;

        float angle = (cameraHolder.transform.rotation.eulerAngles.x - rotationFactor) % 360;

        if (IsAngleInRange(angle))
        {
            cameraHolder.transform.Rotate(Vector3.left, rotationFactor, Space.Self);
        }
    }
Esempio n. 3
0
    void Update()
    {
        float rotationH = InputManager.GetAxis("Mouse X");
        float rotationV = InputManager.GetAxis("Mouse Y");

        rotationV         = Mathf.Clamp(-rotationV * RotationSensitivity, -80 - verticalRotation, 80 - verticalRotation);
        verticalRotation += rotationV;

        Camera.main.transform.Rotate(new Vector3(0, rotationH * RotationSensitivity, 0), Space.World);
        Camera.main.transform.Rotate(new Vector3(rotationV, 0, 0));

        float forwardSpeed = InputManager.GetAxis("Vertical");
        float sideWaySpeed = InputManager.GetAxis("Horizontal");

        Vector3 speed = new Vector3(sideWaySpeed, 0, forwardSpeed) * WalkSpeed;

        Camera.main.transform.Translate(speed);

        float elevation = InputManager.GetAxis("Elevation");

        Camera.main.transform.Translate(new Vector3(0, elevation, 0) * WalkSpeed, Space.World);
    }
        public void UpdateSwipe()
        {
            var horizontal = CrossPlatformInputManager.GetAxis(_horizontalAxisName);
            var vertical   = CrossPlatformInputManager.GetAxis(_verticalAxisName);

            //No Touch Occured
            if (vertical == 0 && horizontal == 0)
            {
                return;
            }
            if (Input.touchCount > 1)
            {
            }
            //If they swipe at exactly a 45 register as horizontal so atleast we registered a hit
            if (Mathf.Abs(horizontal) >= Mathf.Abs(vertical))
            {
                HandleHorizontalMovement(horizontal);
            }
            else
            {
                HandleVerticalMovement(vertical);
            }
        }
Esempio n. 5
0
 void HorizontalRotation()
 {
     transform.Rotate(Vector3.up, Time.deltaTime * rotationSpeed * InputManager.GetAxis(horizontalAxisName));
 }
Esempio n. 6
0
 private void Update()
 {
     xAxis = InputManager.GetAxis(xAxisName);
     zAxis = InputManager.GetAxis(zAxisName);
 }