LabelLineDrawer.cs 1.1 KB

12345678910111213141516171819202122232425262728293031
  1. using UnityEditor;
  2. using UnityEngine;
  3. using XCharts.Runtime;
  4. namespace XCharts.Editor
  5. {
  6. [CustomPropertyDrawer(typeof(LabelLine), true)]
  7. public class LabelLineDrawer : BasePropertyDrawer
  8. {
  9. public override string ClassName { get { return "LabelLine"; } }
  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_LineType");
  17. PropertyField(prop, "m_LineColor");
  18. PropertyField(prop, "m_LineAngle");
  19. PropertyField(prop, "m_LineWidth");
  20. PropertyField(prop, "m_LineGap");
  21. PropertyField(prop, "m_LineLength1");
  22. PropertyField(prop, "m_LineLength2");
  23. PropertyField(prop, "m_LineEndX");
  24. PropertyField(prop, "m_StartSymbol");
  25. PropertyField(prop, "m_EndSymbol");
  26. --EditorGUI.indentLevel;
  27. }
  28. }
  29. }
  30. }