Пример #1
0
    private void Update()
    {
        var mouseDelta = Input.mousePosition - lastMousePosition;

        if (mouseDelta.magnitude != 0)
        {
            pointer.SetPointerPosition(Input.mousePosition);
        }
        if (Input.GetMouseButtonDown(0))
        {
            pointer.PointerDown = true;
        }
        else if (Input.GetMouseButtonUp(0))
        {
            pointer.PointerDown = false;
        }
        lastMousePosition = Input.mousePosition;
    }
Пример #2
0
 private bool PointerSetPositionTest(Vector3 position, VirtualPointer pointer)
 {
     pointer.SetPointerPosition(position);
     return(pointer.transform.position == position);
 }