/************************************************************************************************************************/ /// <summary> /// Draws controls for <see cref="AnimancerState.IsPlaying"/>, <see cref="AnimancerState.Speed"/>, and /// <see cref="AnimancerState.Weight"/>. /// </summary> protected void DoPlayingDetailsGUI() { var labelWidth = EditorGUIUtility.labelWidth; var area = AnimancerEditorUtilities.GetRect(true); var right = area.xMax; // Is Playing. var label = AnimancerEditorUtilities.BeginTightLabel("Is Playing"); area.width = EditorGUIUtility.labelWidth + 16; State.IsPlaying = EditorGUI.Toggle(area, label, State.IsPlaying); AnimancerEditorUtilities.EndTightLabel(); area.x += area.width; area.xMax = right; float speedWidth, weightWidth; Rect speedRect, weightRect; AnimancerEditorUtilities.SplitHorizontally(area, "Speed", "Weight", out speedWidth, out weightWidth, out speedRect, out weightRect); var indentLevel = EditorGUI.indentLevel; EditorGUI.indentLevel = 0; // Speed. EditorGUIUtility.labelWidth = speedWidth; EditorGUI.BeginChangeCheck(); var speed = EditorGUI.FloatField(speedRect, "Speed", State.Speed); if (EditorGUI.EndChangeCheck()) { State.Speed = speed; } // Weight. EditorGUIUtility.labelWidth = weightWidth; EditorGUI.BeginChangeCheck(); var weight = EditorGUI.FloatField(weightRect, "Weight", State.Weight); if (EditorGUI.EndChangeCheck()) { State.Weight = weight; } EditorGUI.indentLevel = indentLevel; EditorGUIUtility.labelWidth = labelWidth; }