public static IDisposable LabelWidth(float width) { var prevWidth = EditorGUIUtility.labelWidth; EditorGUIUtility.labelWidth = width; return(DisposableAction.Create(() => EditorGUIUtility.labelWidth = prevWidth)); }
public static IDisposable Color(Color color) { var oldColor = GUI.color; GUI.color = color; return(DisposableAction.Create(() => GUI.color = oldColor)); }
public static IDisposable Enabled(bool enabled) { bool wasEnabled = GUI.enabled; GUI.enabled = wasEnabled && enabled; return(DisposableAction.Create(() => GUI.enabled = wasEnabled)); }
public static IDisposable Area(Rect rect) { GUILayout.BeginArea(rect); return(DisposableAction.Create(() => GUILayout.EndArea())); }
internal static IDisposable Horizontal(params GUILayoutOption[] options) { EditorGUILayout.BeginHorizontal(options); return(DisposableAction.Create(EditorGUILayout.EndHorizontal)); }
internal static IDisposable Vertical(GUIStyle style, params GUILayoutOption[] options) { EditorGUILayout.BeginVertical(style, options); return(DisposableAction.Create(EditorGUILayout.EndVertical)); }
public static IDisposable ScrollViewWindow(Vector2 scroll) { EditorGUILayout.BeginScrollView(scroll, false, false, GUIStyle.none, GUIStyle.none, GUIStyle.none); return(DisposableAction.Create(EditorGUILayout.EndScrollView)); }
public static IDisposable ScrollView(ref Vector2 scroll, GUIStyle style, params GUILayoutOption[] options) { scroll = EditorGUILayout.BeginScrollView(scroll, style, options); return(DisposableAction.Create(EditorGUILayout.EndScrollView)); }
public static IDisposable ScrollView(ref Vector2 scroll) { scroll = EditorGUILayout.BeginScrollView(scroll); return(DisposableAction.Create(EditorGUILayout.EndScrollView)); }