コード例 #1
0
    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);
        }
    }
コード例 #2
0
    public void ClickUp(InteractionData data)
    {
        if (_logInteractions)
        {
            Debug.Log(gameObject.name + " clicked up by " + data.interactingTransform.name);
        }

        _lastInteractionData = data;

        OnClickUp?.Invoke(data);
    }
コード例 #3
0
 private void TouchUp(float x, float y)
 {
     OnClickUp?.Invoke(x, y);
 }
コード例 #4
0
 public void OnPointerUp(PointerEventData eventData)
 {
     OnClickUp?.Invoke();
 }