GridCoordEditor.cs 871 B

12345678910111213141516171819202122232425262728
  1. using UnityEditor;
  2. using XCharts.Runtime;
  3. namespace XCharts.Editor
  4. {
  5. [ComponentEditor(typeof(GridCoord))]
  6. public class GridCoordEditor : MainComponentEditor<GridCoord>
  7. {
  8. public override void OnInspectorGUI()
  9. {
  10. ++EditorGUI.indentLevel;
  11. var layoutIndex = baseProperty.FindPropertyRelative("m_LayoutIndex").intValue;
  12. PropertyField("m_LayoutIndex");
  13. if (layoutIndex < 0)
  14. {
  15. PropertyField("m_Left");
  16. PropertyField("m_Right");
  17. PropertyField("m_Top");
  18. PropertyField("m_Bottom");
  19. }
  20. PropertyField("m_BackgroundColor");
  21. PropertyField("m_ShowBorder");
  22. PropertyField("m_BorderWidth");
  23. PropertyField("m_BorderColor");
  24. --EditorGUI.indentLevel;
  25. }
  26. }
  27. }