Keine Beschreibung
Du kannst nicht mehr als 25 Themen auswählen Themen müssen mit entweder einem Buchstaben oder einer Ziffer beginnen. Sie können Bindestriche („-“) enthalten und bis zu 35 Zeichen lang sein.

LabelStyleDrawer.cs 1.4KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. using UnityEditor;
  2. using UnityEngine;
  3. using XCharts.Runtime;
  4. namespace XCharts.Editor
  5. {
  6. [CustomPropertyDrawer(typeof(LabelStyle), true)]
  7. public class LabelStyleDrawer : BasePropertyDrawer
  8. {
  9. public override string ClassName { get { return "Label"; } }
  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_Position");
  17. PropertyField(prop, "m_Formatter");
  18. PropertyField(prop, "m_NumericFormatter");
  19. PropertyField(prop, "m_AutoOffset");
  20. PropertyField(prop, "m_Offset");
  21. PropertyField(prop, "m_Distance");
  22. PropertyField(prop, "m_Rotate");
  23. PropertyField(prop, "m_Width");
  24. PropertyField(prop, "m_Height");
  25. PropertyField(prop, "m_Icon");
  26. PropertyField(prop, "m_Background");
  27. PropertyField(prop, "m_TextStyle");
  28. PropertyField(prop, "m_TextPadding");
  29. --EditorGUI.indentLevel;
  30. }
  31. }
  32. }
  33. [CustomPropertyDrawer(typeof(EndLabelStyle), true)]
  34. public class EndLabelStyleDrawer : LabelStyleDrawer
  35. {
  36. public override string ClassName { get { return "End Label"; } }
  37. }
  38. }