mirror of
https://github.com/XCharts-Team/XCharts.git
synced 2026-05-17 05:50:09 +00:00
移除Pie组件,相关参数放到Settings中配置
This commit is contained in:
@@ -15,13 +15,11 @@ namespace XCharts
|
||||
{
|
||||
base.OnEnable();
|
||||
m_Target = (PieChart)target;
|
||||
m_Pie = serializedObject.FindProperty("m_Pie");
|
||||
}
|
||||
|
||||
protected override void OnEndInspectorGUI()
|
||||
{
|
||||
base.OnEndInspectorGUI();
|
||||
EditorGUILayout.PropertyField(m_Pie, true);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,57 +0,0 @@
|
||||
using UnityEditor;
|
||||
using UnityEngine;
|
||||
|
||||
namespace XCharts
|
||||
{
|
||||
[CustomPropertyDrawer(typeof(Pie), true)]
|
||||
public class PieInfoDrawer : PropertyDrawer
|
||||
{
|
||||
SerializedProperty m_Name;
|
||||
SerializedProperty m_InsideRadius;
|
||||
SerializedProperty m_OutsideRadius;
|
||||
SerializedProperty m_TooltipExtraRadius;
|
||||
SerializedProperty m_Rose;
|
||||
SerializedProperty m_Space;
|
||||
SerializedProperty m_Left;
|
||||
SerializedProperty m_Right;
|
||||
SerializedProperty m_Top;
|
||||
SerializedProperty m_Bottom;
|
||||
SerializedProperty m_Selected;
|
||||
SerializedProperty m_SelectedIndex;
|
||||
SerializedProperty m_SelectedOffset;
|
||||
bool m_PieModuleToggle = true;
|
||||
|
||||
private void InitProperty(SerializedProperty prop)
|
||||
{
|
||||
m_TooltipExtraRadius = prop.FindPropertyRelative("m_TooltipExtraRadius");
|
||||
m_SelectedOffset = prop.FindPropertyRelative("m_SelectedOffset");
|
||||
}
|
||||
|
||||
public override void OnGUI(Rect pos, SerializedProperty prop, GUIContent label)
|
||||
{
|
||||
InitProperty(prop);
|
||||
Rect drawRect = pos;
|
||||
drawRect.height = EditorGUIUtility.singleLineHeight;
|
||||
ChartEditorHelper.MakeFoldout(ref drawRect, ref m_PieModuleToggle, "Pie");
|
||||
drawRect.y += EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing;
|
||||
if (m_PieModuleToggle)
|
||||
{
|
||||
++EditorGUI.indentLevel;
|
||||
EditorGUI.PropertyField(drawRect, m_TooltipExtraRadius);
|
||||
drawRect.y += EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing;
|
||||
EditorGUI.PropertyField(drawRect, m_SelectedOffset);
|
||||
drawRect.y += EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing;
|
||||
|
||||
--EditorGUI.indentLevel;
|
||||
}
|
||||
}
|
||||
|
||||
public override float GetPropertyHeight(SerializedProperty prop, GUIContent label)
|
||||
{
|
||||
if (m_PieModuleToggle)
|
||||
return 3 * EditorGUIUtility.singleLineHeight + 2 * EditorGUIUtility.standardVerticalSpacing;
|
||||
else
|
||||
return EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,13 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 019eadbd43e952945925f357ae8ef74b
|
||||
timeCreated: 1554773154
|
||||
licenseType: Free
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -18,6 +18,8 @@ namespace XCharts
|
||||
SerializedProperty m_LineSegmentDistance = prop.FindPropertyRelative("m_LineSegmentDistance");
|
||||
SerializedProperty m_CicleSmoothness = prop.FindPropertyRelative("m_CicleSmoothness");
|
||||
SerializedProperty m_VisualMapTriangeLen = prop.FindPropertyRelative("m_VisualMapTriangeLen");
|
||||
SerializedProperty m_PieTooltipExtraRadius = prop.FindPropertyRelative("m_PieTooltipExtraRadius");
|
||||
SerializedProperty m_PieSelectedOffset = prop.FindPropertyRelative("m_PieSelectedOffset");
|
||||
|
||||
ChartEditorHelper.MakeFoldout(ref drawRect, ref m_SettingsModuleToggle, "Settings");
|
||||
EditorGUI.LabelField(drawRect, "Settings", EditorStyles.boldLabel);
|
||||
@@ -35,6 +37,10 @@ namespace XCharts
|
||||
drawRect.y += EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing;
|
||||
EditorGUI.PropertyField(drawRect, m_VisualMapTriangeLen);
|
||||
drawRect.y += EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing;
|
||||
EditorGUI.PropertyField(drawRect, m_PieTooltipExtraRadius);
|
||||
drawRect.y += EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing;
|
||||
EditorGUI.PropertyField(drawRect, m_PieSelectedOffset);
|
||||
drawRect.y += EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing;
|
||||
--EditorGUI.indentLevel;
|
||||
}
|
||||
}
|
||||
@@ -44,7 +50,7 @@ namespace XCharts
|
||||
int num = 1;
|
||||
if (m_SettingsModuleToggle)
|
||||
{
|
||||
num = 6;
|
||||
num = 8;
|
||||
}
|
||||
return num * EditorGUIUtility.singleLineHeight + (num - 1) * EditorGUIUtility.standardVerticalSpacing;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user