InputDeviceGCPart.cs 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Threading.Tasks;
  6. namespace SC.XR.Unity.Module_InputSystem.InputDeviceGC {
  7. public abstract class InputDeviceGCPart : InputDevicePartBase {
  8. public InputDeviceGC inputDeviceGC {
  9. get { return Transition<InputDeviceGC>(inputDeviceBase); }
  10. }
  11. public InputDeviceGCPartUI inputDeviceGCPartUI {
  12. get { return Transition<InputDeviceGCPartUI>(inputDevicePartUIBase); }
  13. }
  14. public GCDetector gcDetector {
  15. get { return Transition<GCDetector>(detectorBase); }
  16. }
  17. public abstract PostureType PostureType { get; set; }
  18. public InputDataGC inputDataGC {get; set;}
  19. public InputDataGetGC inputDataGetGC { get; set; }
  20. public InputDeviceGCPartStatus inputDevicePartStatusGC { get; set; }
  21. public InputDevicePartDispatchEventGC inputDevicePartDispatchEventGC { get; set; }
  22. public override void OnSCStart() {
  23. if(inputDataBase != null)
  24. inputDataBase.ModuleStart();
  25. if(inputDevicePartStatusBase != null)
  26. inputDevicePartStatusBase.ModuleStart();
  27. }
  28. public override void OnSCLateUpdate() {
  29. base.OnSCLateUpdate();
  30. if(inputDataBase.isVaild == false) {
  31. if(inputDataGetBase != null && inputDataGetBase.IsModuleStarted)
  32. inputDataGetBase.ModuleStop();
  33. } else {
  34. if(inputDataGetBase != null && !inputDataGetBase.IsModuleStarted)
  35. inputDataGetBase.ModuleStart();
  36. }
  37. }
  38. }
  39. }