You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

111 lines
3.9 KiB

  1. using UnityEngine;
  2. namespace UnityEditor.PostProcessing
  3. {
  4. public static class FxStyles
  5. {
  6. public static GUIStyle tickStyleRight;
  7. public static GUIStyle tickStyleLeft;
  8. public static GUIStyle tickStyleCenter;
  9. public static GUIStyle preSlider;
  10. public static GUIStyle preSliderThumb;
  11. public static GUIStyle preButton;
  12. public static GUIStyle preDropdown;
  13. public static GUIStyle preLabel;
  14. public static GUIStyle hueCenterCursor;
  15. public static GUIStyle hueRangeCursor;
  16. public static GUIStyle centeredBoldLabel;
  17. public static GUIStyle wheelThumb;
  18. public static Vector2 wheelThumbSize;
  19. public static GUIStyle header;
  20. public static GUIStyle headerCheckbox;
  21. public static GUIStyle headerFoldout;
  22. public static Texture2D playIcon;
  23. public static Texture2D checkerIcon;
  24. public static Texture2D paneOptionsIcon;
  25. public static GUIStyle centeredMiniLabel;
  26. static FxStyles()
  27. {
  28. tickStyleRight = new GUIStyle("Label")
  29. {
  30. alignment = TextAnchor.MiddleRight,
  31. fontSize = 9
  32. };
  33. tickStyleLeft = new GUIStyle("Label")
  34. {
  35. alignment = TextAnchor.MiddleLeft,
  36. fontSize = 9
  37. };
  38. tickStyleCenter = new GUIStyle("Label")
  39. {
  40. alignment = TextAnchor.MiddleCenter,
  41. fontSize = 9
  42. };
  43. preSlider = new GUIStyle("PreSlider");
  44. preSliderThumb = new GUIStyle("PreSliderThumb");
  45. preButton = new GUIStyle("PreButton");
  46. preDropdown = new GUIStyle("preDropdown");
  47. preLabel = new GUIStyle("ShurikenLabel");
  48. hueCenterCursor = new GUIStyle("ColorPicker2DThumb")
  49. {
  50. normal = { background = (Texture2D)EditorGUIUtility.LoadRequired("Builtin Skins/DarkSkin/Images/ShurikenPlus.png") },
  51. fixedWidth = 6,
  52. fixedHeight = 6
  53. };
  54. hueRangeCursor = new GUIStyle(hueCenterCursor)
  55. {
  56. normal = { background = (Texture2D)EditorGUIUtility.LoadRequired("Builtin Skins/DarkSkin/Images/CircularToggle_ON.png") }
  57. };
  58. wheelThumb = new GUIStyle("ColorPicker2DThumb");
  59. centeredBoldLabel = new GUIStyle(GUI.skin.GetStyle("Label"))
  60. {
  61. alignment = TextAnchor.UpperCenter,
  62. fontStyle = FontStyle.Bold
  63. };
  64. centeredMiniLabel = new GUIStyle(EditorStyles.centeredGreyMiniLabel)
  65. {
  66. alignment = TextAnchor.UpperCenter
  67. };
  68. wheelThumbSize = new Vector2(
  69. !Mathf.Approximately(wheelThumb.fixedWidth, 0f) ? wheelThumb.fixedWidth : wheelThumb.padding.horizontal,
  70. !Mathf.Approximately(wheelThumb.fixedHeight, 0f) ? wheelThumb.fixedHeight : wheelThumb.padding.vertical
  71. );
  72. header = new GUIStyle("ShurikenModuleTitle")
  73. {
  74. font = (new GUIStyle("Label")).font,
  75. border = new RectOffset(15, 7, 4, 4),
  76. fixedHeight = 22,
  77. contentOffset = new Vector2(20f, -2f)
  78. };
  79. headerCheckbox = new GUIStyle("ShurikenCheckMark");
  80. headerFoldout = new GUIStyle("Foldout");
  81. playIcon = (Texture2D)EditorGUIUtility.LoadRequired("Builtin Skins/DarkSkin/Images/IN foldout act.png");
  82. checkerIcon = (Texture2D)EditorGUIUtility.LoadRequired("Icons/CheckerFloor.png");
  83. if (EditorGUIUtility.isProSkin)
  84. paneOptionsIcon = (Texture2D)EditorGUIUtility.LoadRequired("Builtin Skins/DarkSkin/Images/pane options.png");
  85. else
  86. paneOptionsIcon = (Texture2D)EditorGUIUtility.LoadRequired("Builtin Skins/LightSkin/Images/pane options.png");
  87. }
  88. }
  89. }