private bool PointerMoveTest(Vector2 movement, VirtualPointer pointer) { var initialPosition = pointer.transform.position; pointer.MovePointer(movement); return(pointer.transform.position == initialPosition + (Vector3)movement); }
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; } }