HandTipSample.cs 842 B

1234567891011121314151617181920212223242526272829
  1. using UnityEngine;
  2. using Rokid.UXR.UI;
  3. using Rokid.UXR.Interaction;
  4. namespace Rokid.UXR.Utility
  5. {
  6. public class HandTipSample : MonoBehaviour
  7. {
  8. private void Start()
  9. {
  10. GesEventInput.OnHandLostInCameraSpace += OnHandLostInCameraSpace;
  11. }
  12. private void OnDestroy()
  13. {
  14. GesEventInput.OnHandLostInCameraSpace -= OnHandLostInCameraSpace;
  15. }
  16. private void OnHandLostInCameraSpace(HandType handType)
  17. {
  18. if (InputModuleManager.Instance.GetGesActive())
  19. {
  20. RKLog.Info("====HandTipSample====: OnHandLostInCameraSpace");
  21. //增加提示
  22. UIManager.Instance().CreatePanel<TipPanel>(true).Init("请将手放置在相机的可视范围内", TipLevel.Warning, 0.5f);
  23. }
  24. }
  25. }
  26. }