StyledSpaceDrawer.cs 788 B

12345678910111213141516171819202122232425262728293031
  1. // Cristian Pop - https://boxophobic.com/
  2. using UnityEngine;
  3. using UnityEditor;
  4. namespace Boxophobic.StyledGUI
  5. {
  6. public class StyledSpaceDrawer : MaterialPropertyDrawer
  7. {
  8. public float space;
  9. public StyledSpaceDrawer(float space)
  10. {
  11. this.space = space;
  12. }
  13. public override void OnGUI(Rect position, MaterialProperty prop, string label, MaterialEditor materialEditor)
  14. {
  15. //EditorGUI.DrawRect(position, new Color(0, 1, 0, 0.05f));
  16. //Material material = materialEditor.target as Material;
  17. GUILayout.Space(space);
  18. }
  19. public override float GetPropertyHeight(MaterialProperty prop, string label, MaterialEditor editor)
  20. {
  21. return -2;
  22. }
  23. }
  24. }