重构minShowDataNumber、maxShowDataNumber、maxCacheDataNumber到Serie的minShow、maxShow、maxCache

This commit is contained in:
monitor1394
2019-09-29 07:37:53 +08:00
parent c54d62c8f8
commit 2a1ad8886e
14 changed files with 118 additions and 112 deletions

View File

@@ -22,9 +22,6 @@ namespace XCharts
protected SerializedProperty m_Series;
protected SerializedProperty m_Large;
protected SerializedProperty m_MinShowDataNumber;
protected SerializedProperty m_MaxShowDataNumber;
protected SerializedProperty m_MaxCacheDataNumber;
protected SerializedProperty m_LineSmoothStyle;
protected float m_DefaultLabelWidth;
@@ -46,9 +43,6 @@ namespace XCharts
m_Series = serializedObject.FindProperty("m_Series");
m_Large = serializedObject.FindProperty("m_Large");
m_MinShowDataNumber = serializedObject.FindProperty("m_MinShowDataNumber");
m_MaxShowDataNumber = serializedObject.FindProperty("m_MaxShowDataNumber");
m_MaxCacheDataNumber = serializedObject.FindProperty("m_MaxCacheDataNumber");
m_LineSmoothStyle = serializedObject.FindProperty("m_LineSmoothStyle");
}
@@ -92,13 +86,7 @@ namespace XCharts
EditorGUI.indentLevel++;
var largeTip = "Whether to enable the optimization of large-scale graph. \n是否启用大规模线图的优化在数据图形特别多的时候>=5k可以开启。";
EditorGUILayout.PropertyField(m_Large, new GUIContent("Large", largeTip));
EditorGUILayout.PropertyField(m_MinShowDataNumber, true);
EditorGUILayout.PropertyField(m_MaxShowDataNumber, true);
EditorGUILayout.PropertyField(m_MaxCacheDataNumber, true);
EditorGUILayout.PropertyField(m_LineSmoothStyle,true);
if (m_MinShowDataNumber.intValue < 0) m_MinShowDataNumber.intValue = 0;
if (m_MaxShowDataNumber.intValue < 0) m_MaxShowDataNumber.intValue = 0;
if (m_MaxCacheDataNumber.intValue < 0) m_MaxCacheDataNumber.intValue = 0;
EditorGUI.indentLevel--;
}
}

View File

@@ -23,6 +23,10 @@ namespace XCharts
SerializedProperty stack = prop.FindPropertyRelative("m_Stack");
SerializedProperty m_AxisIndex = prop.FindPropertyRelative("m_AxisIndex");
SerializedProperty m_RadarIndex = prop.FindPropertyRelative("m_RadarIndex");
SerializedProperty m_MinShow = prop.FindPropertyRelative("m_MinShow");
SerializedProperty m_MaxShow = prop.FindPropertyRelative("m_MaxShow");
SerializedProperty m_MaxCache = prop.FindPropertyRelative("m_MaxCache");
SerializedProperty m_LineStyle = prop.FindPropertyRelative("m_LineStyle");
SerializedProperty m_LineArrow = prop.FindPropertyRelative("m_LineArrow");
SerializedProperty m_LineType = prop.FindPropertyRelative("m_LineType");
@@ -79,6 +83,15 @@ namespace XCharts
EditorGUI.PropertyField(drawRect, m_AxisIndex);
drawRect.y += EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing;
}
EditorGUI.PropertyField(drawRect, m_MinShow);
drawRect.y += EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing;
EditorGUI.PropertyField(drawRect, m_MaxShow);
drawRect.y += EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing;
EditorGUI.PropertyField(drawRect, m_MaxCache);
drawRect.y += EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing;
if (m_MinShow.intValue < 0) m_MinShow.intValue = 0;
if (m_MinShow.intValue < 0) m_MinShow.intValue = 0;
if (m_MaxCache.intValue < 0) m_MaxCache.intValue = 0;
if (serieType == SerieType.Line)
{
EditorGUI.PropertyField(drawRect, m_LineType);
@@ -325,7 +338,7 @@ namespace XCharts
}
else
{
height += 6 * EditorGUIUtility.singleLineHeight + 6 * EditorGUIUtility.standardVerticalSpacing;
height += 9 * EditorGUIUtility.singleLineHeight + 8 * EditorGUIUtility.standardVerticalSpacing;
height += EditorGUI.GetPropertyHeight(prop.FindPropertyRelative("m_LineStyle"));
height += EditorGUI.GetPropertyHeight(prop.FindPropertyRelative("m_AreaStyle"));
height += EditorGUI.GetPropertyHeight(prop.FindPropertyRelative("m_Label"));