InputDeviceGCPartUI.cs 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. using System.Collections;
  2. using UnityEngine;
  3. namespace SC.XR.Unity.Module_InputSystem.InputDeviceGC {
  4. public class InputDeviceGCPartUI : InputDevicePartUIBase {
  5. public InputDeviceGCPart inputDeviceGCPart {
  6. get {
  7. return inputDevicePartBase as InputDeviceGCPart;
  8. }
  9. }
  10. public ModelGCBase ModelGC;
  11. public ResetLoading resetLoading { get { return GetComponentInChildren<ResetLoading>(true); } }
  12. public override void OnSCAwake() {
  13. base.OnSCAwake();
  14. ModelGC = modelBase as ModelGCBase;
  15. AddModule(resetLoading);
  16. }
  17. public override void OnSCLateUpdate() {
  18. base.OnSCLateUpdate();
  19. OnUpdateResetLoading();
  20. }
  21. protected virtual void OnUpdateResetLoading() {
  22. if(inputDeviceGCPart.inputDataGetGC.inputDataGetGCPosture == null)
  23. return;
  24. if(inputDeviceGCPart.inputDataGC.inputKeys.GetKeyDown(inputDeviceGCPart.inputDataGetGC.inputDataGetGCPosture.CalibrationKey)) {
  25. resetLoading.ModuleStart();
  26. } else if(inputDeviceGCPart.inputDataGC.inputKeys.GetKeyUp(inputDeviceGCPart.inputDataGetGC.inputDataGetGCPosture.CalibrationKey)) {
  27. resetLoading.ModuleStop();
  28. }
  29. }
  30. }
  31. }