增加SerieData可单独设置SerieSymbol#66

This commit is contained in:
monitor1394
2020-06-17 12:46:04 +08:00
parent c187226465
commit 17c8b76c54
17 changed files with 114 additions and 41 deletions

View File

@@ -486,8 +486,13 @@ namespace XCharts
var m_ItemStyle = serieData.FindPropertyRelative("m_ItemStyle");
var m_EnableEmphasis = serieData.FindPropertyRelative("m_EnableEmphasis");
var m_Emphasis = serieData.FindPropertyRelative("m_Emphasis");
var m_EnableSymbol = serieData.FindPropertyRelative("m_EnableSymbol");
var m_Symbol = serieData.FindPropertyRelative("m_Symbol");
EditorGUI.PropertyField(drawRect, m_Icon);
drawRect.y += EditorGUI.GetPropertyHeight(m_Icon);
EditorGUI.PropertyField(drawRect, m_Symbol);
ChartEditorHelper.MakeBool(drawRect, m_EnableSymbol, 1, "(enable)");
drawRect.y += EditorGUI.GetPropertyHeight(m_Symbol);
EditorGUI.PropertyField(drawRect, m_Label);
ChartEditorHelper.MakeBool(drawRect, m_EnableLabel, 1, "(enable)");
drawRect.y += EditorGUI.GetPropertyHeight(m_Label);
@@ -497,7 +502,6 @@ namespace XCharts
EditorGUI.PropertyField(drawRect, m_Emphasis);
ChartEditorHelper.MakeBool(drawRect, m_EnableEmphasis, 1, "(enable)");
drawRect.y += EditorGUI.GetPropertyHeight(m_Emphasis);
EditorGUI.indentLevel -= 2;
}
}
@@ -607,6 +611,7 @@ namespace XCharts
{
var item = m_Data.GetArrayElementAtIndex(i);
height += EditorGUI.GetPropertyHeight(item.FindPropertyRelative("m_IconStyle"));
height += EditorGUI.GetPropertyHeight(item.FindPropertyRelative("m_Symbol"));
height += EditorGUI.GetPropertyHeight(item.FindPropertyRelative("m_Label"));
height += EditorGUI.GetPropertyHeight(item.FindPropertyRelative("m_ItemStyle"));
height += EditorGUI.GetPropertyHeight(item.FindPropertyRelative("m_Emphasis"));

View File

@@ -20,6 +20,7 @@ namespace XCharts
{
Rect drawRect = pos;
drawRect.height = EditorGUIUtility.singleLineHeight;
SerializedProperty m_Show = prop.FindPropertyRelative("m_Show");
SerializedProperty m_Type = prop.FindPropertyRelative("m_Type");
SerializedProperty m_SizeType = prop.FindPropertyRelative("m_SizeType");
SerializedProperty m_Size = prop.FindPropertyRelative("m_Size");
@@ -32,12 +33,14 @@ namespace XCharts
SerializedProperty m_ForceShowLast = prop.FindPropertyRelative("m_ForceShowLast");
SerializedProperty m_Gap = prop.FindPropertyRelative("m_Gap");
ChartEditorHelper.MakeFoldout(ref drawRect, ref m_SerieSymbolToggle, prop, null, m_Type, false);
ChartEditorHelper.MakeFoldout(ref drawRect, ref m_SerieSymbolToggle, prop, null, m_Show, false);
drawRect.y += EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing;
if (ChartEditorHelper.IsToggle(m_SerieSymbolToggle, prop))
{
++EditorGUI.indentLevel;
EditorGUI.PropertyField(drawRect, m_Type);
drawRect.y += EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing;
EditorGUI.PropertyField(drawRect, m_Gap);
drawRect.y += EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing;
EditorGUI.PropertyField(drawRect, m_SizeType);
@@ -78,16 +81,18 @@ namespace XCharts
{
SerializedProperty m_SizeType = prop.FindPropertyRelative("m_SizeType");
SerieSymbolSizeType sizeType = (SerieSymbolSizeType)m_SizeType.enumValueIndex;
var hig = 9 * EditorGUIUtility.singleLineHeight + 9 * EditorGUIUtility.standardVerticalSpacing;
switch (sizeType)
{
case SerieSymbolSizeType.Custom:
return 8 * EditorGUIUtility.singleLineHeight + 8 * EditorGUIUtility.standardVerticalSpacing;
break;
case SerieSymbolSizeType.FromData:
return 9 * EditorGUIUtility.singleLineHeight + 9 * EditorGUIUtility.standardVerticalSpacing;
hig += 1 * EditorGUIUtility.singleLineHeight + 1 * EditorGUIUtility.standardVerticalSpacing;
break;
case SerieSymbolSizeType.Callback:
return 8 * EditorGUIUtility.singleLineHeight + 8 * EditorGUIUtility.standardVerticalSpacing;
break;
}
return 8 * EditorGUIUtility.singleLineHeight + 8 * EditorGUIUtility.standardVerticalSpacing;
return hig;
}
else
{