BorderStyleDrawer.cs 831 B

12345678910111213141516171819202122232425
  1. using UnityEditor;
  2. using UnityEngine;
  3. using XCharts.Runtime;
  4. namespace XCharts.Editor
  5. {
  6. [CustomPropertyDrawer(typeof(BorderStyle), true)]
  7. public class BorderStyleDrawer : BasePropertyDrawer
  8. {
  9. public override string ClassName { get { return "Border"; } }
  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_BorderWidth");
  17. PropertyField(prop, "m_BorderColor");
  18. PropertyField(prop, "m_RoundedCorner");
  19. PropertyListField(prop, "m_CornerRadius", true);
  20. --EditorGUI.indentLevel;
  21. }
  22. }
  23. }
  24. }