HandHintExampleEditor.cs 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. using System.Collections;
  2. using System.Collections.Generic;
  3. using UnityEngine;
  4. using UnityEditor;
  5. using VRTK;
  6. [CustomEditor(typeof(HandHintExampleTest))]
  7. public class HandHintExampleEditor : Editor
  8. {
  9. HandHintExampleTest example;
  10. private void OnEnable()
  11. {
  12. example = target as HandHintExampleTest;
  13. }
  14. public override void OnInspectorGUI()
  15. {
  16. example._controllerHand = (SDK_BaseController.ControllerHand)EditorGUILayout.EnumPopup("手柄类型:", example._controllerHand);
  17. if (GUILayout.Button("打开对应手柄全部按钮提示"))
  18. {
  19. example.SetHandHintState(true);
  20. }
  21. if (GUILayout.Button("打开对应手柄全部按钮提示并闪烁"))
  22. {
  23. example.SetHandHintState(true, true);
  24. }
  25. if (GUILayout.Button("关闭对应手柄提示"))
  26. {
  27. example.SetHandHintState(false);
  28. }
  29. example._buttonType = (SDK_BaseController.ButtonTypes)EditorGUILayout.EnumPopup("按键类型:", example._buttonType);
  30. if (GUILayout.Button("打开对应按钮提示"))
  31. {
  32. example.ShowHandHintWithButtonType();
  33. }
  34. if (GUILayout.Button("关闭对应按钮提示"))
  35. {
  36. example.CloseHandHintWithButtonType();
  37. }
  38. }
  39. }