private void UpdateNew(float deltaTime)
    {
        Vector2 touch = VRInput.PadTouchValue(handType);
        float   x     = touch.x;
        float   y     = touch.y;

        if (VRInput.GetControlDown(handType, ControlType.DPadCenter))
        {
            OnClickMiddle?.Invoke(x, y);
            return;
        }

        if (VRInput.GetControlDown(handType, ControlType.DPadNorth))
        {
            OnClickUp?.Invoke(x, y);
        }
        else if (VRInput.GetControlDown(handType, ControlType.DPadSouth))
        {
            OnClickDown?.Invoke(x, y);
        }
        if (VRInput.GetControlDown(handType, ControlType.DPadWest))
        {
            OnClickLeft?.Invoke(x, y);
        }
        else if (VRInput.GetControlDown(handType, ControlType.DPadEast))
        {
            OnClickRight?.Invoke(x, y);
        }
    }
Esempio n. 2
0
    /*------------------------------------------------------------------*\
    |*							HOOKS
    \*------------------------------------------------------------------*/

    public void Update()
    {
        if (Input.GetMouseButtonDown(0))
        {
            InitDragging();
            OnClickLeft?.Invoke();
        }

        if (Input.GetMouseButtonDown(1))
        {
            OnClickRight?.Invoke();
        }

        if (Input.GetMouseButtonUp(0))
        {
            dragging = false;
        }

        if (dragging && Vector3.Distance(start, Input.mousePosition) > dragSensibility)
        {
            OnDrag?.Invoke();
        }
    }
Esempio n. 3
0
 public void ClickRightEvent() => OnClickRight?.Invoke();
 private void TouchRight(float x, float y)
 {
     OnClickRight?.Invoke(x, y);
 }