3.0 - optimize code

This commit is contained in:
monitor1394
2022-03-04 22:17:32 +08:00
parent 1ee0df09eb
commit 5745fea9a1
59 changed files with 482 additions and 435 deletions

View File

@@ -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;
}
}

View File

@@ -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;
}

View File

@@ -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");

View 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;
}
}
}

View File

@@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 7a1ff119a53a44e5abe2ef6f57816aa6
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -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");