InputDeviceKSPart.cs 2.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. using System;
  2. using System.Collections;
  3. using System.Collections.Generic;
  4. using System.Linq;
  5. using System.Text;
  6. using System.Threading.Tasks;
  7. using UnityEngine;
  8. using UnityEngine.InputSystem;
  9. namespace SC.XR.Unity.Module_InputSystem.InputDeviceGC.KS {
  10. public class InputDeviceKSPart : InputDeviceGCPart {
  11. public InputDeviceKS inputDeviceKS {
  12. get { return Transition<InputDeviceKS>(inputDeviceBase); }
  13. }
  14. public InputDeviceKSPartUI inputDeviceKSPartUI {
  15. get { return Transition<InputDeviceKSPartUI>(inputDevicePartUIBase); }
  16. }
  17. public KSDetector bT3DofDetector {
  18. get { return Transition<KSDetector>(detectorBase); }
  19. }
  20. public InputDataKS inputDataKS {get; set;}
  21. public InputDataGetKS inputDataGetKS { get; set; }
  22. public InputDeviceKSPartStatus inputDevicePartStatusKS { get; set; }
  23. public InputDevicePartDispatchEventKS inputDevicePartDispatchEventKS { get; set; }
  24. protected override void ModuleCreater() {
  25. inputDataBase = inputDataGC = inputDataKS = new InputDataKS(this);
  26. inputDataGetBase = inputDataGetGC = inputDataGetKS = new InputDataGetKS(this);
  27. inputDevicePartStatusBase = inputDevicePartStatusGC = inputDevicePartStatusKS = new InputDeviceKSPartStatus(this);
  28. inputDevicePartDispatchEventBase = inputDevicePartDispatchEventGC = inputDevicePartDispatchEventKS = new InputDevicePartDispatchEventKS(this);
  29. }
  30. [SerializeField]
  31. public InputActionProperty m_PositionInput;
  32. [SerializeField]
  33. public InputActionProperty m_RotationInput;
  34. [SerializeField]
  35. public InputActionProperty triggerInput;
  36. public GameObject followGame;
  37. private void Update()
  38. {
  39. #if !UNITY_EDITOR
  40. this.transform.position = followGame.transform.position+ followGame.transform.forward*0.1f;
  41. this.transform.eulerAngles = new Vector3(followGame.transform.eulerAngles.x-24, followGame.transform.eulerAngles.y, followGame.transform.eulerAngles.z);
  42. this.gameObject.SetActive(followGame.activeSelf);
  43. #endif
  44. }
  45. }
  46. }