12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849 |
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- using UnityEngine;
- using UnityEngine.EventSystems;
- namespace SC.XR.Unity.Module_InputSystem.InputDeviceHand {
- public class InputDeviceHandPartDynamicOpenEvent : InputDeviceHandPartEventBase {
- public InputDeviceHandPartDynamicOpenEvent(InputDevicePartDispatchEventHand inputDevicePartDispatchEventHand) : base(inputDevicePartDispatchEventHand) {
- }
- public override void OnSCStart() {
- base.OnSCStart();
- newEvent = previousEvent = currentEvent = HandEventType.Null;
- }
- HandEventType newEvent;
- protected override void OnUpdateEvent() {
- currentEvent = HandEventType.Null;
-
- if (1 == handInfo.iv_extinfo.ges_dynamic[1]) {
- newEvent = HandEventType.Dynamic_Open;
- } else if (-1 == handInfo.iv_extinfo.ges_dynamic[1]) {
- newEvent = HandEventType.Null;
- }
- if (newEvent != previousEvent) {
- previousEvent = newEvent;
- currentEvent = newEvent;
- }
-
- //if (currentEvent != HandEventType.Null) {
- // DebugMy.Log(inputDeviceHandPart.PartType + " Event -----> " + currentEvent, this, true);
- //}
- }
- public override void OnSCDisable() {
- if (previousEvent != HandEventType.Null) {
- currentEvent = HandEventType.Null;
- }
- base.OnSCDisable();
- }
- }
- }
|