SystemUICommu.cs 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. using UnityEngine;
  2. namespace EZXR.Glass.Core
  3. {
  4. public class SystemUICommu : MonoBehaviour
  5. {
  6. bool lastRayState_L = false;
  7. bool lastRayState_R = false;
  8. // Start is called before the first frame update
  9. void Start()
  10. {
  11. }
  12. // Update is called once per frame
  13. void Update()
  14. {
  15. //if (InputSystem.leftHand == null || InputSystem.rightHand == null)
  16. //{
  17. // return;
  18. //}
  19. //if (lastRayState_L != InputSystem.leftHand.IsRayContacting || lastRayState_R != InputSystem.rightHand.IsRayContacting)
  20. //{
  21. // if (InputSystem.leftHand.IsRayContacting || InputSystem.rightHand.IsRayContacting)
  22. // {
  23. // Utilities.Android.SendIntent("ToSystem", "com.ezxr.glass.systemui", "RayState", "False");
  24. // }
  25. // else
  26. // {
  27. // Utilities.Android.SendIntent("ToSystem", "com.ezxr.glass.systemui", "RayState", "True");
  28. // }
  29. // lastRayState_L = InputSystem.leftHand.IsRayContacting;
  30. // lastRayState_R = InputSystem.rightHand.IsRayContacting;
  31. //}
  32. }
  33. private void OnApplicationPause(bool pause)
  34. {
  35. if (!pause)
  36. {
  37. Utilities.Android.SendIntent("ToSystem", "com.ezxr.glass.systemui", "RefreshHandState", "");
  38. }
  39. }
  40. }
  41. }