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); } }
/*------------------------------------------------------------------*\ |* 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(); } }
public void ClickRightEvent() => OnClickRight?.Invoke();
private void TouchRight(float x, float y) { OnClickRight?.Invoke(x, y); }