Bez popisu
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.

StateStyleDrawer.cs 1.8KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. using System.Collections.Generic;
  2. using UnityEditor;
  3. using UnityEngine;
  4. using XCharts.Runtime;
  5. namespace XCharts.Editor
  6. {
  7. [CustomPropertyDrawer(typeof(StateStyle), true)]
  8. public class StateStyleDrawer : BasePropertyDrawer
  9. {
  10. public override string ClassName { get { return "StateStyle"; } }
  11. public override void OnGUI(Rect pos, SerializedProperty prop, GUIContent label)
  12. {
  13. base.OnGUI(pos, prop, label);
  14. if (MakeComponentFoldout(prop, "m_Show", true))
  15. {
  16. ++EditorGUI.indentLevel;
  17. OnCustomGUI(prop);
  18. PropertyField(prop, "m_Symbol");
  19. PropertyField(prop, "m_ItemStyle");
  20. PropertyField(prop, "m_Label");
  21. PropertyField(prop, "m_LabelLine");
  22. PropertyField(prop, "m_LineStyle");
  23. PropertyField(prop, "m_AreaStyle");
  24. --EditorGUI.indentLevel;
  25. }
  26. }
  27. protected virtual void OnCustomGUI(SerializedProperty prop) { }
  28. }
  29. [CustomPropertyDrawer(typeof(EmphasisStyle), true)]
  30. public class EmphasisStyleDrawer : StateStyleDrawer
  31. {
  32. public override string ClassName { get { return "EmphasisStyle"; } }
  33. protected override void OnCustomGUI(SerializedProperty prop)
  34. {
  35. PropertyField(prop, "m_Scale");
  36. PropertyField(prop, "m_Focus");
  37. PropertyField(prop, "m_BlurScope");
  38. }
  39. }
  40. [CustomPropertyDrawer(typeof(BlurStyle), true)]
  41. public class BlurStyleDrawer : StateStyleDrawer
  42. {
  43. public override string ClassName { get { return "BlurStyle"; } }
  44. }
  45. [CustomPropertyDrawer(typeof(SelectStyle), true)]
  46. public class SelectStyleDrawer : StateStyleDrawer
  47. {
  48. public override string ClassName { get { return "SelectStyle"; } }
  49. }
  50. }