HandHintExampleTest.cs 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. using System.Collections;
  2. using System.Collections.Generic;
  3. using UnityEngine;
  4. using VRTK;
  5. /// <summary>
  6. /// 手柄提示案例
  7. /// </summary>
  8. public class HandHintExampleTest : MonoBehaviour
  9. {
  10. public SDK_BaseController.ControllerHand _controllerHand = SDK_BaseController.ControllerHand.Right;
  11. public SDK_BaseController.ButtonTypes _buttonType = SDK_BaseController.ButtonTypes.Touchpad;
  12. public void ShowHandHintWithButtonType()
  13. {
  14. HandHintController.GetInstance().ShowHandHint(_controllerHand, _buttonType);
  15. }
  16. public void CloseHandHintWithButtonType()
  17. {
  18. HandHintController.GetInstance().CloseHandHint(_controllerHand, _buttonType);
  19. }
  20. /// <summary>
  21. /// 按钮提示全部关闭或者全部打开
  22. /// </summary>
  23. /// <param name="state">提示状态</param>
  24. public void SetHandHintState(bool state)
  25. {
  26. HandHintController.GetInstance().SetHandHint(_controllerHand, state);
  27. }
  28. /// <summary>
  29. /// 按钮提示全部关闭或者全部打开
  30. /// </summary>
  31. /// <param name="state">提示状态</param>
  32. /// <param name="flash">是否开启闪烁</param>
  33. public void SetHandHintState(bool state, bool flash)
  34. {
  35. HandHintController.GetInstance().SetHandHint(_controllerHand, state, flash);
  36. }
  37. }