From cc72f303f1516dc9ff2fc0b7edb18e5bef2a2b27 Mon Sep 17 00:00:00 2001 From: monitor1394 Date: Wed, 3 Nov 2021 06:48:45 +0800 Subject: [PATCH] Add `Time` axis warning --- Editor/PropertyDrawers/AxisDrawer.cs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/Editor/PropertyDrawers/AxisDrawer.cs b/Editor/PropertyDrawers/AxisDrawer.cs index 45721f6a..c4a2d02f 100644 --- a/Editor/PropertyDrawers/AxisDrawer.cs +++ b/Editor/PropertyDrawers/AxisDrawer.cs @@ -29,6 +29,12 @@ namespace XCharts EditorGUI.indentLevel++; PropertyField(prop, isPolar ? "m_PolarIndex" : "m_GridIndex"); PropertyField(prop, "m_Type"); + if (type == Axis.AxisType.Time) + { + var chartTypeName = prop.serializedObject.targetObject.GetType().Name; + if (!chartTypeName.Equals("GanttChart")) + EditorGUILayout.HelpBox("The Time axis is currently only supported in GanttChart.", MessageType.Warning); + } PropertyField(prop, "m_Position"); PropertyField(prop, "m_Offset"); if (type == Axis.AxisType.Log)