12345678910111213141516171819202122232425262728293031323334353637383940414243 |
- using System.Collections;
- using System.Collections.Generic;
- using UnityEngine;
- using UnityEditor;
- using VRTK;
- [CustomEditor(typeof(HandHintExampleTest))]
- public class HandHintExampleEditor : Editor
- {
- HandHintExampleTest example;
- private void OnEnable()
- {
- example = target as HandHintExampleTest;
- }
- public override void OnInspectorGUI()
- {
- example._controllerHand = (SDK_BaseController.ControllerHand)EditorGUILayout.EnumPopup("手柄类型:", example._controllerHand);
- if (GUILayout.Button("打开对应手柄全部按钮提示"))
- {
- example.SetHandHintState(true);
- }
- if (GUILayout.Button("打开对应手柄全部按钮提示并闪烁"))
- {
- example.SetHandHintState(true, true);
- }
- if (GUILayout.Button("关闭对应手柄提示"))
- {
- example.SetHandHintState(false);
- }
- example._buttonType = (SDK_BaseController.ButtonTypes)EditorGUILayout.EnumPopup("按键类型:", example._buttonType);
- if (GUILayout.Button("打开对应按钮提示"))
- {
- example.ShowHandHintWithButtonType();
- }
- if (GUILayout.Button("关闭对应按钮提示"))
- {
- example.CloseHandHintWithButtonType();
- }
- }
- }
|