using UnityEngine; using UnityEngine.Rendering.PostProcessing; namespace UnityEditor.Rendering.PostProcessing { /// /// Common styles used for Post-processing editor controls. /// public static class Styling { /// /// Style for the override checkbox. /// public static readonly GUIStyle smallTickbox; /// /// Style for the labels in the toolbar of each effect. /// public static readonly GUIStyle miniLabelButton; static readonly Color splitterDark; static readonly Color splitterLight; /// /// Color of UI splitters. /// public static Color splitter { get { return EditorGUIUtility.isProSkin ? splitterDark : splitterLight; } } static readonly Texture2D paneOptionsIconDark; static readonly Texture2D paneOptionsIconLight; /// /// Option icon used in effect headers. /// public static Texture2D paneOptionsIcon { get { return EditorGUIUtility.isProSkin ? paneOptionsIconDark : paneOptionsIconLight; } } /// /// Style for effect header labels. /// public static readonly GUIStyle headerLabel; static readonly Color headerBackgroundDark; static readonly Color headerBackgroundLight; /// /// Color of effect header backgrounds. /// public static Color headerBackground { get { return EditorGUIUtility.isProSkin ? headerBackgroundDark : headerBackgroundLight; } } /// /// Style for the trackball labels. /// public static readonly GUIStyle wheelLabel; /// /// Style for the trackball cursors. /// public static readonly GUIStyle wheelThumb; /// /// Size of the trackball cursors. /// public static readonly Vector2 wheelThumbSize; /// /// Style for the curve editor position info. /// public static readonly GUIStyle preLabel; static Styling() { smallTickbox = new GUIStyle("ShurikenToggle"); miniLabelButton = new GUIStyle(EditorStyles.miniLabel); miniLabelButton.normal = new GUIStyleState { background = RuntimeUtilities.transparentTexture, scaledBackgrounds = null, textColor = Color.grey }; var activeState = new GUIStyleState { background = RuntimeUtilities.transparentTexture, scaledBackgrounds = null, textColor = Color.white }; miniLabelButton.active = activeState; miniLabelButton.onNormal = activeState; miniLabelButton.onActive = activeState; splitterDark = new Color(0.12f, 0.12f, 0.12f, 1.333f); splitterLight = new Color(0.6f, 0.6f, 0.6f, 1.333f); headerBackgroundDark = new Color(0.1f, 0.1f, 0.1f, 0.2f); headerBackgroundLight = new Color(1f, 1f, 1f, 0.2f); paneOptionsIconDark = (Texture2D)EditorGUIUtility.Load("Builtin Skins/DarkSkin/Images/pane options.png"); paneOptionsIconLight = (Texture2D)EditorGUIUtility.Load("Builtin Skins/LightSkin/Images/pane options.png"); headerLabel = new GUIStyle(EditorStyles.miniLabel); wheelThumb = new GUIStyle("ColorPicker2DThumb"); wheelThumbSize = new Vector2( !Mathf.Approximately(wheelThumb.fixedWidth, 0f) ? wheelThumb.fixedWidth : wheelThumb.padding.horizontal, !Mathf.Approximately(wheelThumb.fixedHeight, 0f) ? wheelThumb.fixedHeight : wheelThumb.padding.vertical ); wheelLabel = new GUIStyle(EditorStyles.miniLabel); preLabel = new GUIStyle("ShurikenLabel"); } } }