Ejemplo n.º 1
0
        private bool PointerMoveTest(Vector2 movement, VirtualPointer pointer)
        {
            var initialPosition = pointer.transform.position;

            pointer.MovePointer(movement);
            return(pointer.transform.position == initialPosition + (Vector3)movement);
        }
Ejemplo n.º 2
0
    private void Update()
    {
        var movement = new Vector2(Input.GetAxis(horizontalAxisName),
                                   Input.GetAxis(verticalAxisName));

        if (movement.magnitude != 0)
        {
            pointer.MovePointer(movement * sensitivity);
        }

        if (Input.GetButtonDown(pointerButtonName))
        {
            pointer.PointerDown = true;
        }
        else if (Input.GetButtonUp(pointerButtonName))
        {
            pointer.PointerDown = false;
        }
    }