StatusBarHelper.cs 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  1. using UnityEngine;
  2. namespace UnityEditor.Recorder
  3. {
  4. static class StatusBarHelper
  5. {
  6. static Texture2D s_ErrorIcon;
  7. static Texture2D s_WarningIcon;
  8. static Texture2D s_InfoIcon;
  9. static GUIStyle s_ErrorStyle;
  10. static GUIStyle s_WarningStyle;
  11. static GUIStyle s_InfoStyle;
  12. public static Texture2D errorIcon
  13. {
  14. get
  15. {
  16. if (s_ErrorIcon == null)
  17. s_ErrorIcon = EditorGUIUtility.Load("Icons/console.erroricon.sml.png") as Texture2D;
  18. return s_ErrorIcon;
  19. }
  20. }
  21. public static Texture2D warningIcon
  22. {
  23. get
  24. {
  25. if (s_WarningIcon == null)
  26. s_WarningIcon = EditorGUIUtility.Load("Icons/console.warnicon.sml.png") as Texture2D;
  27. return s_WarningIcon;
  28. }
  29. }
  30. public static Texture2D infoIcon
  31. {
  32. get
  33. {
  34. if (s_InfoIcon == null)
  35. s_InfoIcon = EditorGUIUtility.Load("Icons/console.infoicon.sml.png") as Texture2D;
  36. return s_InfoIcon;
  37. }
  38. }
  39. public static GUIStyle errorStyle
  40. {
  41. get
  42. {
  43. return s_ErrorStyle ?? (s_ErrorStyle = new GUIStyle("CN StatusError"));
  44. }
  45. }
  46. public static GUIStyle warningStyle
  47. {
  48. get
  49. {
  50. return s_WarningStyle ?? (s_WarningStyle = new GUIStyle("CN StatusWarn"));
  51. }
  52. }
  53. public static GUIStyle infoStyle
  54. {
  55. get
  56. {
  57. return s_InfoStyle ?? (s_InfoStyle = new GUIStyle("CN StatusInfo"));
  58. }
  59. }
  60. }
  61. }