void DrawBlendShape(Vowel vowel, BlendShapeInfo info) { EditorGUILayout.BeginHorizontal(); EditorGUILayout.PrefixLabel(vowel.ToString()); DrawBlendShapePopup(info); DrawFactor(info); EditorGUILayout.EndHorizontal(); }
void DrawBlendShapePopup(BlendShapeInfo info) { var newIndex = EditorGUILayout.Popup(info.index + 1, GetBlendShapeArray(), GUILayout.MinWidth(200f)); if (newIndex != info.index + 1) { Undo.RecordObject(target, "Change Blend Shape"); info.index = newIndex - 1; } }
void DrawFactor(BlendShapeInfo info) { float factor = EditorGUILayout.Slider(info.factor, 0f, 2f); if (factor != info.factor) { Undo.RecordObject(target, "Change Blend Factor"); info.factor = factor; } }