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