增加AxisName的Offset偏移配置支持

This commit is contained in:
monitor1394
2019-08-22 19:17:00 +08:00
parent cd328d50b1
commit 8c3ec020e2
3 changed files with 35 additions and 25 deletions

View File

@@ -16,7 +16,7 @@ namespace XCharts
SerializedProperty show = prop.FindPropertyRelative("m_Show");
SerializedProperty m_Name = prop.FindPropertyRelative("m_Name");
SerializedProperty m_Location = prop.FindPropertyRelative("m_Location");
SerializedProperty m_Gap = prop.FindPropertyRelative("m_Gap");
SerializedProperty m_Offset = prop.FindPropertyRelative("m_Offset");
SerializedProperty m_Rotate = prop.FindPropertyRelative("m_Rotate");
SerializedProperty m_Color = prop.FindPropertyRelative("m_Color");
SerializedProperty m_FontSize = prop.FindPropertyRelative("m_FontSize");
@@ -31,8 +31,17 @@ namespace XCharts
drawRect.y += EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing;
EditorGUI.PropertyField(drawRect, m_Location);
drawRect.y += EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing;
EditorGUI.PropertyField(drawRect, m_Gap);
drawRect.y += EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing;
EditorGUI.PropertyField(drawRect, m_Offset);
drawRect.y += EditorGUI.GetPropertyHeight(m_Offset);
// EditorGUI.LabelField(drawRect, "Offset");
// var startX = drawRect.x + EditorGUIUtility.labelWidth - EditorGUI.indentLevel * 15;
// var tempWidth = (pos.width - startX + 35) / 2;
// var xRect = new Rect(startX, drawRect.y, tempWidth, drawRect.height);
// var yRect = new Rect(xRect.x + tempWidth - 20, drawRect.y, tempWidth, drawRect.height);
// var x = EditorGUI.FloatField(xRect, m_Offset.vector2Value.x);
// var y = EditorGUI.FloatField(yRect, m_Offset.vector2Value.y);
// m_Offset.vector2Value = new Vector2(x,y);
// drawRect.y += EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing;
EditorGUI.PropertyField(drawRect, m_Rotate);
drawRect.y += EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing;
EditorGUI.PropertyField(drawRect, m_Color);