AnimancerGUI Class

Summary

[Editor-Only] Various GUI utilities used throughout Animancer.
Assembly
Animancer.dll
Namespace
Animancer.Editor
Base Types
  • Object
graph BT Type-->Base0["Object"] Type["AnimancerGUI"] class Type type-node

Syntax

public static class AnimancerGUI

Fields

Name Constant Value Summary
DontExpandWidth
UnityEngine.GUILayout.ExpandWidth(System.Boolean) set to false.
static
ErrorFieldColor
The highlight color used for fields showing an error.
static
WarningFieldColor
The highlight color used for fields showing a warning.
static

Properties

Name Value Summary
IndentSize float
The number of pixels of indentation for each UnityEditor.EditorGUI.indentLevel increment.
static
LineHeight float
Returns UnityEditor.EditorGUIUtility.singleLineHeight.
static
MiniButton GUIStyle
A more compact UnityEditor.EditorStyles.miniButton with a fixed size as a tiny box.
static
PauseButtonContent GUIContent
Animancer.Editor.AnimancerGUI.IconContent(UnityEngine.GUIContent@,System.String) for a pause button.
static
PlayButtonContent GUIContent
Animancer.Editor.AnimancerGUI.IconContent(UnityEngine.GUIContent@,System.String) for a play button.
static
PlayButtonWidth float
The default width of Animancer.Editor.AnimancerGUI.PlayButtonContent using UnityEditor.EditorStyles.miniButton.
static
StandardSpacing float
Returns UnityEditor.EditorGUIUtility.standardVerticalSpacing.
static
StepBackwardButtonContent GUIContent
Animancer.Editor.AnimancerGUI.IconContent(UnityEngine.GUIContent@,System.String) for a step backward button.
static
StepForwardButtonContent GUIContent
Animancer.Editor.AnimancerGUI.IconContent(UnityEngine.GUIContent@,System.String) for a step forward button.
static
TextColor Color
The color of the standard label text.
static
ToggleWidth float
The width of a standard UnityEngine.GUISkin.toggle with no label.
static

Methods

Name Value Summary
BeginTightLabel(string) string
Stores the UnityEditor.EditorGUIUtility.labelWidth and changes it to the exact width of the `label`.
static
BeginVerticalBox(GUIStyle) void
Begins a vertical layout group using the given style and decreases the UnityEditor.EditorGUIUtility.labelWidth to compensate for the indentation.
static
CalculateLabelWidth(string) float
Calls UnityEngine.GUIStyle.CalcMinMaxWidth(UnityEngine.GUIContent,System.Single@,System.Single@) using UnityEngine.GUISkin.label and returns the max width. The result is cached for efficient reuse.
static
CalculateWidth(GUIStyle, GUIContent) float
[Animancer Extension] Calls UnityEngine.GUIStyle.CalcMinMaxWidth(UnityEngine.GUIContent,System.Single@,System.Single@) and returns the max width.
static
CalculateWidth(GUIStyle, string) float
[Animancer Extension] Calls UnityEngine.GUIStyle.CalcMinMaxWidth(UnityEngine.GUIContent,System.Single@,System.Single@) and returns the max width.
static
CompactMiniButton(GUIContent) bool
Draws a button using UnityEditor.EditorStyles.miniButton and Animancer.Editor.AnimancerGUI.DontExpandWidth.
static
CompactMiniButton(Rect, GUIContent) bool
Draws a button using UnityEditor.EditorStyles.miniButton.
static
CreateWidthCache(GUIStyle) ConversionCache<string, float>
Creates a Animancer.Editor.ConversionCache`2 for calculating the GUI width occupied by text using the specified `style`.
static
Deselect() void
Deselects any selected IMGUI control.
static
DoWeightLabel(Rect, float) void
Draws a label showing the `weight` aligned to the right side of the `area` and reduces its UnityEngine.Rect.width to remove that label from its area.
static
EndTightLabel() void
Reverts UnityEditor.EditorGUIUtility.labelWidth to its previous value.
static
EndVerticalBox(GUIStyle) void
Ends a layout group started by Animancer.Editor.AnimancerGUI.BeginVerticalBox(UnityEngine.GUIStyle) and restores the UnityEditor.EditorGUIUtility.labelWidth.
static
GetNarrowText(string) string
Returns the `text` without any spaces if UnityEditor.EditorGUIUtility.wideMode is false. Otherwise simply returns the `text` without any changes.
static
HandleDragAndDrop<T>(Rect, Func<T, bool>, Action<T>, DragAndDropVisualMode) void
Invokes `onDrop` if the UnityEngine.Event.current is a drag and drop event inside the `dropArea`.
static
HandleDragAndDropAnimations(Rect, Action<AnimationClip>, DragAndDropVisualMode) void
Uses Animancer.Editor.AnimancerGUI.HandleDragAndDrop``1(UnityEngine.Rect,System.Func{``0,System.Boolean},System.Action{``0},UnityEditor.DragAndDropVisualMode) to deal with drag and drop operations involving UnityEngine.AnimationClips of UnityEngine.IAnimationClipSources.
static
IconContent(GUIContent, string) GUIContent
Calls UnityEditor.EditorGUIUtility.IconContent(System.String) if the `content` was null.
static
LayoutSingleLineRect(AnimancerGUI.SpacingMode) Rect
Uses UnityEngine.GUILayoutUtility.GetRect(System.Single,System.Single) to get a UnityEngine.Rect occupying a single standard line with the Animancer.Editor.AnimancerGUI.StandardSpacing added according to the specified `spacing`.
static
LoadIcon(string) Texture
Loads an icon texture and sets it to use UnityEngine.FilterMode.Bilinear.
static
NextVerticalArea(Rect) void
If the UnityEngine.Rect.height is positive, this method moves the UnityEngine.Rect.y by that amount and adds the UnityEditor.EditorGUIUtility.standardVerticalSpacing.
static
RepaintEverything() void
Calls UnityEditorInternal.InternalEditorUtility.RepaintAllViews.
static
ReSelectCurrentObjects() void
Clears the UnityEditor.Selection.objects then returns it to its current state.
static
SplitHorizontally(Rect, string, string, float, float, Rect, Rect) void
Divides the given `area` such that the fields associated with both labels will have equal space remaining after the labels themselves.
static
StealFromLeft(Rect, float, float) Rect
Subtracts the `width` from the left side of the `area` and returns a new UnityEngine.Rect occupying the removed section.
static
StealFromRight(Rect, float, float) Rect
Subtracts the `width` from the right side of the `area` and returns a new UnityEngine.Rect occupying the removed section.
static
TryUseClickEvent(Rect, int) bool
Returns true and uses the current event if it is UnityEngine.EventType.MouseUp inside the specified `area`.
static
TryUseClickEventInLastRect(int) bool
Returns true and uses the current event if it is UnityEngine.EventType.MouseUp inside the last GUI Layout UnityEngine.Rect that was drawn.
static