EditorStyles.cs 1.9 KB

1234567891011121314151617181920212223242526272829303132
  1. using UnityEditor;
  2. using UnityEngine;
  3. namespace XCharts.Editor
  4. {
  5. public class EditorCustomStyles
  6. {
  7. static readonly Color splitterDark = new Color(0.12f, 0.12f, 0.12f, 0.5f);
  8. static readonly Color splitterLight = new Color(0.6f, 0.6f, 0.6f, 0.5f);
  9. static readonly Texture2D paneOptionsIconDark = (Texture2D) EditorGUIUtility.Load("Builtin Skins/DarkSkin/Images/pane options.png");
  10. static readonly Texture2D paneOptionsIconLight = (Texture2D) EditorGUIUtility.Load("Builtin Skins/LightSkin/Images/pane options.png");
  11. static readonly Color headerBackgroundDark = new Color(0.1f, 0.1f, 0.1f, 0.2f);
  12. static readonly Color headerBackgroundLight = new Color(1f, 1f, 1f, 0.2f);
  13. public static readonly GUIStyle headerStyle = UnityEditor.EditorStyles.boldLabel;
  14. public static readonly GUIStyle foldoutStyle = new GUIStyle(UnityEditor.EditorStyles.foldout)
  15. {
  16. font = headerStyle.font,
  17. fontStyle = headerStyle.fontStyle,
  18. };
  19. public static readonly GUIContent iconAdd = new GUIContent("+", "Add");
  20. public static readonly GUIContent iconRemove = new GUIContent("-", "Remove");
  21. public static readonly GUIContent iconUp = new GUIContent("↑", "Up");
  22. public static readonly GUIContent iconDown = new GUIContent("↓", "Down");
  23. public static readonly GUIStyle invisibleButton = "InvisibleButton";
  24. public static readonly GUIStyle smallTickbox = new GUIStyle("ShurikenToggle");
  25. public static Color splitter { get { return EditorGUIUtility.isProSkin ? splitterDark : splitterLight; } }
  26. public static Texture2D paneOptionsIcon { get { return EditorGUIUtility.isProSkin ? paneOptionsIconDark : paneOptionsIconLight; } }
  27. public static Color headerBackground { get { return EditorGUIUtility.isProSkin ? headerBackgroundDark : headerBackgroundLight; } }
  28. }
  29. }