mirror of
https://github.com/XCharts-Team/XCharts.git
synced 2026-05-27 11:40:13 +00:00
3.0 - optimize code
This commit is contained in:
@@ -167,7 +167,7 @@ namespace XCharts.Editor
|
||||
{
|
||||
sb.Length = 0;
|
||||
sb.AppendFormat("v{0}", XChartsMgr.fullVersion);
|
||||
//if(m_EnableTextMeshPro.boolValue)
|
||||
if(m_EnableTextMeshPro.boolValue)
|
||||
sb.Append("-tmp");
|
||||
EditorGUILayout.HelpBox(sb.ToString(), MessageType.None);
|
||||
}
|
||||
@@ -265,7 +265,7 @@ namespace XCharts.Editor
|
||||
}
|
||||
if (GUILayout.Button("Reinit Component"))
|
||||
{
|
||||
m_Chart.ReinitAllChartComponent();
|
||||
m_Chart.RemoveAndReinitChartObject();
|
||||
}
|
||||
if (m_CheckWarning)
|
||||
{
|
||||
|
||||
@@ -21,7 +21,6 @@ namespace XCharts.Editor
|
||||
PropertyField(prop, "m_HighlightColor");
|
||||
PropertyField(prop, "m_HighlightToColor");
|
||||
PropertyField(prop, "m_Opacity");
|
||||
PropertyField(prop, "m_TooltipHighlight");
|
||||
--EditorGUI.indentLevel;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -17,7 +17,7 @@ namespace XCharts.Editor
|
||||
++EditorGUI.indentLevel;
|
||||
PropertyField(prop, "m_FoldSeries");
|
||||
PropertyField(prop, "m_ShowDebugInfo");
|
||||
PropertyField(prop, "m_ShowAllChildObject");
|
||||
PropertyField(prop, "m_ShowAllChartObject");
|
||||
PropertyField(prop, "m_DebugInfoTextStyle");
|
||||
--EditorGUI.indentLevel;
|
||||
}
|
||||
|
||||
@@ -23,7 +23,6 @@ namespace XCharts.Editor
|
||||
PropertyField(prop, "m_BackgroundWidth");
|
||||
PropertyField(prop, "m_CenterColor");
|
||||
PropertyField(prop, "m_CenterGap");
|
||||
PropertyField(prop, "m_BorderType");
|
||||
PropertyField(prop, "m_BorderWidth");
|
||||
PropertyField(prop, "m_BorderColor");
|
||||
PropertyField(prop, "m_BorderColor0");
|
||||
|
||||
38
Editor/ChildComponents/LevelStyleDrawer.cs
Normal file
38
Editor/ChildComponents/LevelStyleDrawer.cs
Normal file
@@ -0,0 +1,38 @@
|
||||
|
||||
using UnityEditor;
|
||||
using UnityEngine;
|
||||
using XCharts.Runtime;
|
||||
|
||||
namespace XCharts.Editor
|
||||
{
|
||||
[CustomPropertyDrawer(typeof(LevelStyle), true)]
|
||||
public class LevelStyleDrawer : BasePropertyDrawer
|
||||
{
|
||||
public override string ClassName { get { return "LevelStyle"; } }
|
||||
public override void OnGUI(Rect pos, SerializedProperty prop, GUIContent label)
|
||||
{
|
||||
base.OnGUI(pos, prop, label);
|
||||
if (MakeComponentFoldout(prop, "m_Show"))
|
||||
{
|
||||
++EditorGUI.indentLevel;
|
||||
PropertyListField(prop, "m_Levels");
|
||||
--EditorGUI.indentLevel;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
[CustomPropertyDrawer(typeof(Level), true)]
|
||||
public class LevelDrawer : BasePropertyDrawer
|
||||
{
|
||||
public override string ClassName { get { return "Level"; } }
|
||||
public override void OnGUI(Rect pos, SerializedProperty prop, GUIContent label)
|
||||
{
|
||||
base.OnGUI(pos, prop, label);
|
||||
++EditorGUI.indentLevel;
|
||||
PropertyField(prop, "m_Label");
|
||||
PropertyField(prop, "m_UpperLabel");
|
||||
PropertyField(prop, "m_ItemStyle");
|
||||
--EditorGUI.indentLevel;
|
||||
}
|
||||
}
|
||||
}
|
||||
11
Editor/ChildComponents/LevelStyleDrawer.cs.meta
Normal file
11
Editor/ChildComponents/LevelStyleDrawer.cs.meta
Normal file
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 7a1ff119a53a44e5abe2ef6f57816aa6
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -39,7 +39,7 @@ namespace XCharts.Editor
|
||||
PropertyField(prop, "m_DataScale");
|
||||
PropertyField(prop, "m_SelectedDataScale");
|
||||
break;
|
||||
case SymbolSizeType.Callback:
|
||||
case SymbolSizeType.Function:
|
||||
break;
|
||||
}
|
||||
PropertyField(prop, "m_StartIndex");
|
||||
|
||||
@@ -8,7 +8,7 @@ namespace XCharts.Editor
|
||||
public override void OnCustomInspectorGUI()
|
||||
{
|
||||
PropertyField("m_RoseType");
|
||||
PropertyField("m_Space");
|
||||
PropertyField("m_Gap");
|
||||
PropertyTwoFiled("m_Center");
|
||||
PropertyTwoFiled("m_Radius");
|
||||
|
||||
|
||||
@@ -10,7 +10,7 @@ namespace XCharts.Editor
|
||||
PropertyTwoFiled("m_Center");
|
||||
PropertyTwoFiled("m_Radius");
|
||||
PropertyField("m_StartAngle");
|
||||
PropertyField("m_RingGap");
|
||||
PropertyField("m_Gap");
|
||||
PropertyField("m_RoundCap");
|
||||
PropertyField("m_Clockwise");
|
||||
|
||||
|
||||
@@ -75,7 +75,7 @@ namespace XCharts.Editor
|
||||
while (listSize > m_Datas.arraySize) m_Datas.arraySize++;
|
||||
while (listSize < m_Datas.arraySize) m_Datas.arraySize--;
|
||||
}
|
||||
if (listSize > 30 && !XCSettings.editorShowAllListData)
|
||||
if (listSize > 30)// && !XCSettings.editorShowAllListData)
|
||||
{
|
||||
int num = listSize > 10 ? 10 : listSize;
|
||||
for (int i = 0; i < num; i++)
|
||||
@@ -191,10 +191,10 @@ namespace XCharts.Editor
|
||||
{
|
||||
EditorGUI.indentLevel++;
|
||||
var serieData = m_Datas.GetArrayElementAtIndex(index);
|
||||
var sereName = serieData.FindPropertyRelative("m_Name");
|
||||
var selected = serieData.FindPropertyRelative("m_Selected");
|
||||
var m_Name = serieData.FindPropertyRelative("m_Name");
|
||||
var m_Id = serieData.FindPropertyRelative("m_Id");
|
||||
var m_ParentId = serieData.FindPropertyRelative("m_ParentId");
|
||||
|
||||
var m_Ignore = serieData.FindPropertyRelative("m_Ignore");
|
||||
var m_IconStyle = serieData.FindPropertyRelative("m_IconStyles");
|
||||
var m_Label = serieData.FindPropertyRelative("m_Labels");
|
||||
var m_ItemStyle = serieData.FindPropertyRelative("m_ItemStyles");
|
||||
@@ -204,9 +204,9 @@ namespace XCharts.Editor
|
||||
var m_AreaStyle = serieData.FindPropertyRelative("m_AreaStyles");
|
||||
var m_TitleStyle = serieData.FindPropertyRelative("m_TitleStyles");
|
||||
|
||||
PropertyField(sereName);
|
||||
PropertyField(selected);
|
||||
PropertyField(m_Ignore);
|
||||
PropertyField(m_Name);
|
||||
PropertyField(m_Id);
|
||||
PropertyField(m_ParentId);
|
||||
|
||||
var componentNum = m_IconStyle.arraySize + m_Label.arraySize + m_ItemStyle.arraySize + m_Emphasis.arraySize
|
||||
+ m_Symbol.arraySize + m_LineStyle.arraySize + m_AreaStyle.arraySize;
|
||||
|
||||
Reference in New Issue
Block a user