123456789101112131415161718192021222324252627282930313233343536373839404142434445464748 |
- using UnityEngine;
- using UnityEngine.EventSystems;
- using Rokid.UXR;
- namespace Rokid.UXR.Interaction
- {
- public class GestureGripInput : BaseInput
- {
- public override bool mousePresent => true;
- public override Vector2 mousePosition => GetGesPosition();
- public override bool touchSupported => false;
- public override int touchCount => 0;
- [SerializeField]
- private HandType hand;
- public void SetHandType(HandType hand)
- {
- this.hand = hand;
- }
- public override bool GetMouseButtonDown(int button)
- {
- return GesEventInput.Instance.GetHandDown(hand, false);
- }
- public override bool GetMouseButtonUp(int button)
- {
- return GesEventInput.Instance.GetHandUp(hand, false);
- }
- public override bool GetMouseButton(int button)
- {
- return GesEventInput.Instance.GetHandPress(hand, false);
- }
- public Vector3 GetGesPosition()
- {
- Vector3 gesPos = Vector2.zero;
- Gesture gesture = GesEventInput.Instance.GetGesture(hand);
- return gesPos;
- }
- }
- }
|