NoloControllerInfo.cs 1.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. using SC.XR.Unity;
  2. using SC.XR.Unity.Module_InputSystem;
  3. using static API_GSXR_Slam;
  4. using UnityEngine;
  5. using TMPro;
  6. public class NoloControllerInfo : ControllerInfoBase
  7. {
  8. [SerializeField]
  9. protected TextMeshProUGUI Text_speed_1;
  10. [SerializeField]
  11. protected TextMeshProUGUI Text_speed_2;
  12. float[] ori = new float[15];
  13. protected new void Start()
  14. {
  15. base.Start();
  16. }
  17. protected new void Update()
  18. {
  19. base.Update();
  20. ShowSpeed();
  21. }
  22. private void ShowSpeed()
  23. {
  24. if (is_Left)
  25. {
  26. API_GSXR_Slam.plugin.GSXR_Get_ControllerPosture(ori, 0);
  27. }
  28. else
  29. {
  30. API_GSXR_Slam.plugin.GSXR_Get_ControllerPosture(ori, 1);
  31. }
  32. Vector3 speed_1 = new Vector3(ori[7], ori[8], ori[9]);
  33. Vector3 speed_2 = new Vector3(ori[10], ori[11], ori[12]);
  34. Text_speed_1.text = speed_1.ToString("f3");
  35. Text_speed_2.text = speed_2.ToString("f3");
  36. }
  37. }