InputDeviceHandPart.cs 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Threading.Tasks;
  6. using UnityEngine;
  7. namespace SC.XR.Unity.Module_InputSystem.InputDeviceHand {
  8. public class InputDeviceHandPart : InputDevicePartBase {
  9. public InputDeviceHand inputDeviceHand {
  10. get { return Transition<InputDeviceHand>(inputDeviceBase); }
  11. }
  12. public InputDeviceHandPartUI inputDeviceHandPartUI {
  13. get { return Transition<InputDeviceHandPartUI>(inputDevicePartUIBase); }
  14. }
  15. public HandDetector gGT26DofDetector {
  16. get { return Transition<HandDetector>(detectorBase); }
  17. }
  18. public InputDataHand inputDataHand {get; set;}
  19. public InputDataGetHand inputDataGetHand { get; set; }
  20. public InputDeviceHandPartStatus inputDevicePartStatusHand { get; set; }
  21. public InputDevicePartDispatchEventHand inputDevicePartDispatchEventHand { get; set; }
  22. [Tooltip("Enable CubeModel")]
  23. public bool EnableCubeHandModel = false;
  24. [Tooltip("Enable EffectHandModel")]
  25. public bool EnableEffectHandModel = false;
  26. public override void OnSCStart() {
  27. if (inputDataBase != null)
  28. inputDataBase.ModuleStart();
  29. if (inputDevicePartStatusBase != null)
  30. inputDevicePartStatusBase.ModuleStart();
  31. }
  32. public override void OnSCLateUpdate() {
  33. base.OnSCLateUpdate();
  34. if (inputDataBase.isVaild == false) {
  35. if (inputDataGetBase != null && inputDataGetBase.IsModuleStarted)
  36. inputDataGetBase.ModuleStop();
  37. } else {
  38. if (inputDataGetBase != null && !inputDataGetBase.IsModuleStarted)
  39. inputDataGetBase.ModuleStart();
  40. }
  41. }
  42. protected override void ModuleCreater() {
  43. inputDevicePartDispatchEventBase = inputDevicePartDispatchEventHand = new InputDevicePartDispatchEventHand(this);
  44. }
  45. }
  46. }