Ingen beskrivning
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

TextPaddingDrawer.cs 903B

123456789101112131415161718192021222324252627282930
  1. using UnityEditor;
  2. using UnityEngine;
  3. using XCharts.Runtime;
  4. namespace XCharts.Editor
  5. {
  6. [CustomPropertyDrawer(typeof(Padding), true)]
  7. public class PaddingDrawer : BasePropertyDrawer
  8. {
  9. public override string ClassName { get { return "Padding"; } }
  10. public override void OnGUI(Rect pos, SerializedProperty prop, GUIContent label)
  11. {
  12. base.OnGUI(pos, prop, label);
  13. if (MakeComponentFoldout(prop, "m_Show", true))
  14. {
  15. ++EditorGUI.indentLevel;
  16. PropertyField(prop, "m_Top");
  17. PropertyField(prop, "m_Right");
  18. PropertyField(prop, "m_Bottom");
  19. PropertyField(prop, "m_Left");
  20. --EditorGUI.indentLevel;
  21. }
  22. }
  23. }
  24. [CustomPropertyDrawer(typeof(TextPadding), true)]
  25. public class TextPaddingDrawer : PaddingDrawer
  26. {
  27. }
  28. }