StyledIndentDrawer.cs 748 B

123456789101112131415161718192021222324252627282930
  1. // Cristian Pop - https://boxophobic.com/
  2. using UnityEngine;
  3. using UnityEditor;
  4. using System;
  5. namespace Boxophobic.StyledGUI
  6. {
  7. public class StyledIndentDrawer : MaterialPropertyDrawer
  8. {
  9. public float indent;
  10. public StyledIndentDrawer(float indent)
  11. {
  12. this.indent = indent;
  13. }
  14. public override void OnGUI(Rect position, MaterialProperty prop, String label, MaterialEditor materialEditor)
  15. {
  16. //Material material = materialEditor.target as Material;
  17. EditorGUI.indentLevel = (int)indent;
  18. }
  19. public override float GetPropertyHeight(MaterialProperty prop, string label, MaterialEditor editor)
  20. {
  21. return -2;
  22. }
  23. }
  24. }