Aucune description
Vous ne pouvez pas sélectionner plus de 25 sujets Les noms de sujets doivent commencer par une lettre ou un nombre, peuvent contenir des tirets ('-') et peuvent comporter jusqu'à 35 caractères.

LevelStyleDrawer.cs 1.2KB

12345678910111213141516171819202122232425262728293031323334353637
  1. using UnityEditor;
  2. using UnityEngine;
  3. using XCharts.Runtime;
  4. namespace XCharts.Editor
  5. {
  6. [CustomPropertyDrawer(typeof(LevelStyle), true)]
  7. public class LevelStyleDrawer : BasePropertyDrawer
  8. {
  9. public override string ClassName { get { return "LevelStyle"; } }
  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. PropertyListField(prop, "m_Levels");
  17. --EditorGUI.indentLevel;
  18. }
  19. }
  20. }
  21. [CustomPropertyDrawer(typeof(Level), true)]
  22. public class LevelDrawer : BasePropertyDrawer
  23. {
  24. public override string ClassName { get { return "Level"; } }
  25. public override void OnGUI(Rect pos, SerializedProperty prop, GUIContent label)
  26. {
  27. base.OnGUI(pos, prop, label);
  28. ++EditorGUI.indentLevel;
  29. PropertyField(prop, "m_Label");
  30. PropertyField(prop, "m_UpperLabel");
  31. PropertyField(prop, "m_ItemStyle");
  32. --EditorGUI.indentLevel;
  33. }
  34. }
  35. }