StyledSpaceDrawer.cs 600 B

12345678910111213141516171819202122232425
  1. // Cristian Pop - https://boxophobic.com/
  2. using UnityEngine;
  3. using UnityEditor;
  4. namespace Boxophobic.StyledGUI
  5. {
  6. [CustomPropertyDrawer(typeof(StyledSpace))]
  7. public class StyledSpaceAttributeDrawer : PropertyDrawer
  8. {
  9. StyledSpace a;
  10. public override void OnGUI(Rect position, SerializedProperty property, GUIContent label)
  11. {
  12. a = (StyledSpace)attribute;
  13. GUILayout.Space(a.space);
  14. }
  15. public override float GetPropertyHeight(SerializedProperty property, GUIContent label)
  16. {
  17. return -2;
  18. }
  19. }
  20. }