InputDeviceGCPart.cs 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  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 InputDataGC inputDataGC {get; set;}
  18. public InputDataGetGC inputDataGetGC { get; set; }
  19. public InputDeviceGCPartStatus inputDevicePartStatusGC { get; set; }
  20. public InputDevicePartDispatchEventGC inputDevicePartDispatchEventGC { get; set; }
  21. public override void OnSCStart() {
  22. if(inputDataBase != null)
  23. inputDataBase.ModuleStart();
  24. if(inputDevicePartStatusBase != null)
  25. inputDevicePartStatusBase.ModuleStart();
  26. }
  27. public override void OnSCLateUpdate() {
  28. base.OnSCLateUpdate();
  29. if(inputDataBase.isVaild == false) {
  30. if(inputDataGetBase != null && inputDataGetBase.IsModuleStarted)
  31. inputDataGetBase.ModuleStop();
  32. } else {
  33. if(inputDataGetBase != null && !inputDataGetBase.IsModuleStarted)
  34. inputDataGetBase.ModuleStart();
  35. }
  36. }
  37. }
  38. }