StyledBannerDrawer.cs 692 B

12345678910111213141516171819202122232425262728
  1. // Cristian Pop - https://boxophobic.com/
  2. using UnityEngine;
  3. using UnityEditor;
  4. using Boxophobic.Constants;
  5. namespace Boxophobic.StyledGUI
  6. {
  7. public class StyledBannerDrawer : MaterialPropertyDrawer
  8. {
  9. public string title;
  10. public StyledBannerDrawer(string title)
  11. {
  12. this.title = title;
  13. }
  14. public override void OnGUI(Rect position, MaterialProperty prop, string label, MaterialEditor materialEditor)
  15. {
  16. StyledGUI.DrawInspectorBanner(title);
  17. }
  18. public override float GetPropertyHeight(MaterialProperty prop, string label, MaterialEditor editor)
  19. {
  20. return -4;
  21. }
  22. }
  23. }