TransitionArmModelEditor.cs 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. using System.Collections;
  2. using System.Collections.Generic;
  3. using UnityEngine;
  4. #if ENABLE_VR || ENABLE_AR
  5. using UnityEngine.XR.LegacyInputHelpers;
  6. namespace UnityEditor.XR.LegacyInputHelpers
  7. {
  8. [CustomEditor(typeof(TransitionArmModel))]
  9. internal class TransitionArmModelEditor : Editor
  10. {
  11. static class Styles
  12. {
  13. public static GUIContent poseSourceLabel = EditorGUIUtility.TrTextContent("Angular Velocity Source", "The source of angular velocity which is used to transition to queued arm models");
  14. public static GUIContent armModelSourceLabel = EditorGUIUtility.TrTextContent("Current Arm Model", "The current arm model ");
  15. public static GUIContent armModelTransitions = EditorGUIUtility.TrTextContent("Configuration", "Arm models that the transition arm model can blend to when receiving the event corresponding to the transition");
  16. }
  17. SerializedProperty m_PoseSourceProp = null;
  18. SerializedProperty m_ArmModelProp = null;
  19. SerializedProperty m_ArmModelTransitions = null;
  20. void OnEnable()
  21. {
  22. m_PoseSourceProp = this.serializedObject.FindProperty("m_PoseSource");
  23. m_ArmModelProp = this.serializedObject.FindProperty("m_CurrentArmModelComponent");
  24. m_ArmModelTransitions = this.serializedObject.FindProperty("m_ArmModelTransitions");
  25. }
  26. public override void OnInspectorGUI()
  27. {
  28. serializedObject.Update();
  29. EditorGUILayout.PropertyField(m_PoseSourceProp, Styles.poseSourceLabel);
  30. EditorGUILayout.PropertyField(m_ArmModelProp, Styles.armModelSourceLabel);
  31. EditorGUILayout.PropertyField(m_ArmModelTransitions, Styles.armModelTransitions,true);
  32. serializedObject.ApplyModifiedProperties();
  33. }
  34. }
  35. }
  36. #endif