InputDeviceHeadPart.cs 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  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.InputDeviceHead {
  8. public class InputDeviceHeadPart : InputDevicePartBase {
  9. public InputDataHead inputDataHead {
  10. get {
  11. return Transition<InputDataHead>(inputDataBase);
  12. }
  13. }
  14. public InputDataGetHead inputDataGetHead {
  15. get {
  16. return Transition<InputDataGetHead>(inputDataBase);
  17. }
  18. }
  19. public InputDeviceHeadPartStatus inputDevicePartStatusHead {
  20. get {
  21. return inputDevicePartStatusBase as InputDeviceHeadPartStatus;
  22. }
  23. }
  24. public InputDevicePartDispatchEventHead inputDevicePartDispatchEventHead {
  25. get {
  26. return inputDevicePartDispatchEventBase as InputDevicePartDispatchEventHead;
  27. }
  28. }
  29. protected override void ModuleCreater() {
  30. inputDataBase = new InputDataHead(this);
  31. inputDataGetBase = new InputDataGetHead(this);
  32. inputDevicePartStatusBase = new InputDeviceHeadPartStatus(this);
  33. inputDevicePartDispatchEventBase = new InputDevicePartDispatchEventHead(this);
  34. }
  35. public override void OnSCLateUpdate() {
  36. base.OnSCLateUpdate();
  37. if(inputDataBase.isVaild == false) {
  38. if(inputDataGetBase != null && inputDataGetBase.IsModuleStarted)
  39. inputDataGetBase.ModuleStop();
  40. } else {
  41. if(inputDataGetBase != null && !inputDataGetBase.IsModuleStarted)
  42. inputDataGetBase.ModuleStart();
  43. }
  44. }
  45. }
  46. }