优化SerieData的自定义图标不与SerieLabel关联,可单独控制是否显示

This commit is contained in:
monitor1394
2019-09-25 09:44:53 +08:00
parent e3ab20bcd2
commit f1199f2aad
11 changed files with 36293 additions and 12576 deletions

View File

@@ -303,9 +303,9 @@ namespace XCharts
var tempWidth = (drawRect.width - startX + 72) / 2;
var centerXRect = new Rect(startX, drawRect.y, tempWidth, drawRect.height);
var centerYRect = new Rect(centerXRect.x + tempWidth - 58, drawRect.y, tempWidth, drawRect.height);
var x = EditorGUI.FloatField(centerXRect, m_IconOffset.vector2Value.x);
var y = EditorGUI.FloatField(centerYRect, m_IconOffset.vector2Value.y);
m_IconOffset.vector2Value = new Vector2(x, y);
var x = EditorGUI.FloatField(centerXRect, m_IconOffset.vector3Value.x);
var y = EditorGUI.FloatField(centerYRect, m_IconOffset.vector3Value.y);
m_IconOffset.vector3Value = new Vector3(x, y);
drawRect.y += EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing;
EditorGUI.indentLevel--;

View File

@@ -16,7 +16,7 @@ namespace XCharts
SerializedProperty show = prop.FindPropertyRelative("m_Show");
SerializedProperty m_Position = prop.FindPropertyRelative("m_Position");
SerializedProperty m_Formatter = prop.FindPropertyRelative("m_Formatter");
SerializedProperty m_Distance = prop.FindPropertyRelative("m_Distance");
SerializedProperty m_Offset = prop.FindPropertyRelative("m_Offset");
SerializedProperty m_Rotate = prop.FindPropertyRelative("m_Rotate");
SerializedProperty m_PaddingLeftRight = prop.FindPropertyRelative("m_PaddingLeftRight");
SerializedProperty m_PaddingTopBottom = prop.FindPropertyRelative("m_PaddingTopBottom");
@@ -41,10 +41,20 @@ namespace XCharts
++EditorGUI.indentLevel;
EditorGUI.PropertyField(drawRect, m_Position);
drawRect.y += EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing;
EditorGUI.LabelField(drawRect, "Offset");
var startX = drawRect.x + EditorGUIUtility.labelWidth - EditorGUI.indentLevel * 15;
var tempWidth = (drawRect.width - startX + 52) / 2;
var centerXRect = new Rect(startX, drawRect.y, tempWidth, drawRect.height);
var centerYRect = new Rect(centerXRect.x + tempWidth - 38, drawRect.y, tempWidth, drawRect.height);
var x = EditorGUI.FloatField(centerXRect, m_Offset.vector3Value.x);
var y = EditorGUI.FloatField(centerYRect, m_Offset.vector3Value.y);
m_Offset.vector3Value = new Vector3(x, y);
drawRect.y += EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing;
EditorGUI.PropertyField(drawRect, m_Formatter);
drawRect.y += EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing;
EditorGUI.PropertyField(drawRect, m_Distance);
drawRect.y += EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing;
EditorGUI.PropertyField(drawRect, m_Color);
drawRect.y += EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing;
EditorGUI.PropertyField(drawRect, m_BackgroundColor);