This commit is contained in:
monitor1394
2022-03-09 07:26:15 +08:00
parent 5745fea9a1
commit 7582a76d1f
55 changed files with 504 additions and 275 deletions

View File

@@ -12,7 +12,7 @@ namespace XCharts.Editor
public override void OnGUI(Rect pos, SerializedProperty prop, GUIContent label)
{
base.OnGUI(pos, prop, label);
if (MakeComponentFoldout(prop, "m_Enable"))
if (MakeComponentFoldout(prop, "m_Enable", true))
{
++EditorGUI.indentLevel;
PropertyField(prop, "m_Type");

View File

@@ -12,7 +12,7 @@ namespace XCharts.Editor
public override void OnGUI(Rect pos, SerializedProperty prop, GUIContent label)
{
base.OnGUI(pos, prop, label);
if (MakeComponentFoldout(prop, "m_Show"))
if (MakeComponentFoldout(prop, "m_Show", true))
{
++EditorGUI.indentLevel;
PropertyField(prop, "m_Origin");

View File

@@ -162,18 +162,19 @@ namespace XCharts.Editor
m_DisplayName, relativeProp);
}
}
protected bool MakeComponentFoldout(SerializedProperty prop, string relativePropName, params HeaderMenuInfo[] menus)
protected bool MakeComponentFoldout(SerializedProperty prop, string relativePropName, bool relativePropEnable,
params HeaderMenuInfo[] menus)
{
if (string.IsNullOrEmpty(relativePropName))
{
return ChartEditorHelper.MakeComponentFoldout(ref m_DrawRect, m_Heights, m_PropToggles, m_KeyName,
m_DisplayName, null, menus);
m_DisplayName, null, relativePropEnable, menus);
}
else
{
{
var relativeProp = prop.FindPropertyRelative(relativePropName);
return ChartEditorHelper.MakeComponentFoldout(ref m_DrawRect, m_Heights, m_PropToggles, m_KeyName,
m_DisplayName, relativeProp, menus);
m_DisplayName, relativeProp, relativePropEnable, menus);
}
}

View File

@@ -16,7 +16,7 @@ namespace XCharts.Editor
public override void OnGUI(Rect pos, SerializedProperty prop, GUIContent label)
{
base.OnGUI(pos, prop, label);
if (MakeComponentFoldout(prop, ""))
if (MakeComponentFoldout(prop, "", true))
{
++EditorGUI.indentLevel;
#if dUI_TextMeshPro
@@ -141,7 +141,7 @@ namespace XCharts.Editor
public override void OnGUI(Rect pos, SerializedProperty prop, GUIContent label)
{
base.OnGUI(pos, prop, label);
if (MakeComponentFoldout(prop, ""))
if (MakeComponentFoldout(prop, "", true))
{
++EditorGUI.indentLevel;
PropertyField(prop, "m_LineWidth");

View File

@@ -12,7 +12,7 @@ namespace XCharts.Editor
public override void OnGUI(Rect pos, SerializedProperty prop, GUIContent label)
{
base.OnGUI(pos, prop, label);
if (MakeComponentFoldout(prop, ""))
if (MakeComponentFoldout(prop, "m_Show", false))
{
++EditorGUI.indentLevel;
PropertyField(prop, "m_FoldSeries");

View File

@@ -13,7 +13,7 @@ namespace XCharts.Editor
public override void OnGUI(Rect pos, SerializedProperty prop, GUIContent label)
{
base.OnGUI(pos, prop, label);
if (MakeComponentFoldout(prop, "m_Show"))
if (MakeComponentFoldout(prop, "m_Show", true))
{
++EditorGUI.indentLevel;
PropertyField(prop, "m_Label");

View File

@@ -12,7 +12,7 @@ namespace XCharts.Editor
public override void OnGUI(Rect pos, SerializedProperty prop, GUIContent label)
{
base.OnGUI(pos, prop, label);
if (MakeComponentFoldout(prop, "m_Show"))
if (MakeComponentFoldout(prop, "m_Show", true))
{
++EditorGUI.indentLevel;
PropertyField(prop, "m_Layer");

View File

@@ -12,7 +12,7 @@ namespace XCharts.Editor
public override void OnGUI(Rect pos, SerializedProperty prop, GUIContent label)
{
base.OnGUI(pos, prop, label);
if (MakeComponentFoldout(prop, "m_Show"))
if (MakeComponentFoldout(prop, "m_Show", false))
{
++EditorGUI.indentLevel;
PropertyField(prop, "m_Color");

View File

@@ -12,7 +12,7 @@ namespace XCharts.Editor
public override void OnGUI(Rect pos, SerializedProperty prop, GUIContent label)
{
base.OnGUI(pos, prop, label);
if (MakeComponentFoldout(prop, "m_Show"))
if (MakeComponentFoldout(prop, "m_Show", true))
{
++EditorGUI.indentLevel;
PropertyField(prop, "m_LineType");

View File

@@ -12,7 +12,7 @@ namespace XCharts.Editor
public override void OnGUI(Rect pos, SerializedProperty prop, GUIContent label)
{
base.OnGUI(pos, prop, label);
if (MakeComponentFoldout(prop, "m_Show"))
if (MakeComponentFoldout(prop, "m_Show", true))
{
++EditorGUI.indentLevel;
PropertyField(prop, "m_Position");

View File

@@ -12,7 +12,7 @@ namespace XCharts.Editor
public override void OnGUI(Rect pos, SerializedProperty prop, GUIContent label)
{
base.OnGUI(pos, prop, label);
if (MakeComponentFoldout(prop, "m_Show"))
if (MakeComponentFoldout(prop, "m_Show", true))
{
++EditorGUI.indentLevel;
PropertyListField(prop, "m_Levels");

View File

@@ -12,7 +12,7 @@ namespace XCharts.Editor
public override void OnGUI(Rect pos, SerializedProperty prop, GUIContent label)
{
base.OnGUI(pos, prop, label);
if (MakeComponentFoldout(prop, ""))
if (MakeComponentFoldout(prop, "", true))
{
++EditorGUI.indentLevel;
PropertyField(prop, "m_Width");
@@ -32,7 +32,7 @@ namespace XCharts.Editor
public override void OnGUI(Rect pos, SerializedProperty prop, GUIContent label)
{
base.OnGUI(pos, prop, label);
if (MakeComponentFoldout(prop, "m_Show"))
if (MakeComponentFoldout(prop, "m_Show", true))
{
++EditorGUI.indentLevel;
PropertyField(prop, "m_Position");

View File

@@ -12,7 +12,7 @@ namespace XCharts.Editor
public override void OnGUI(Rect pos, SerializedProperty prop, GUIContent label)
{
base.OnGUI(pos, prop, label);
if (MakeComponentFoldout(prop, "m_Show"))
if (MakeComponentFoldout(prop, "m_Show", true))
{
++EditorGUI.indentLevel;
DrawExtendeds(prop);

View File

@@ -12,7 +12,7 @@ namespace XCharts.Editor
public override void OnGUI(Rect pos, SerializedProperty prop, GUIContent label)
{
base.OnGUI(pos, prop, label);
if (MakeComponentFoldout(prop, "m_Show"))
if (MakeComponentFoldout(prop, "m_Show", true))
{
++EditorGUI.indentLevel;
PropertyField(prop, "m_Type");

View File

@@ -12,7 +12,7 @@ namespace XCharts.Editor
public override void OnGUI(Rect pos, SerializedProperty prop, GUIContent label)
{
base.OnGUI(pos, prop, label);
if (MakeComponentFoldout(prop, "m_Align"))
if (MakeComponentFoldout(prop, "m_Align", true))
{
++EditorGUI.indentLevel;
PropertyField(prop, "m_Top");

View File

@@ -12,7 +12,7 @@ namespace XCharts.Editor
public override void OnGUI(Rect pos, SerializedProperty prop, GUIContent label)
{
base.OnGUI(pos, prop, label);
if (MakeComponentFoldout(prop, "m_Show", new HeaderMenuInfo("Reset", () =>
if (MakeComponentFoldout(prop, "m_Show", false, new HeaderMenuInfo("Reset", () =>
{
var chart = prop.serializedObject.targetObject as BaseChart;
chart.settings.Reset();

View File

@@ -13,7 +13,7 @@ namespace XCharts.Editor
public override void OnGUI(Rect pos, SerializedProperty prop, GUIContent label)
{
base.OnGUI(pos, prop, label);
if (MakeComponentFoldout(prop, "m_Show"))
if (MakeComponentFoldout(prop, "m_Show", true))
{
++EditorGUI.indentLevel;
var type = (SymbolType)prop.FindPropertyRelative("m_Type").enumValueIndex;

View File

@@ -12,7 +12,7 @@ namespace XCharts.Editor
public override void OnGUI(Rect pos, SerializedProperty prop, GUIContent label)
{
base.OnGUI(pos, prop, label);
if (MakeComponentFoldout(prop, "m_Enable"))
if (MakeComponentFoldout(prop, "m_Enable", true))
{
++EditorGUI.indentLevel;
PropertyField(prop, "m_MaxWidth");

View File

@@ -15,7 +15,7 @@ namespace XCharts.Editor
public override void OnGUI(Rect pos, SerializedProperty prop, GUIContent label)
{
base.OnGUI(pos, prop, label);
if (MakeComponentFoldout(prop, ""))
if (MakeComponentFoldout(prop, "", true))
{
++EditorGUI.indentLevel;
#if dUI_TextMeshPro

View File

@@ -19,7 +19,7 @@ namespace XCharts.Editor
var defaultWidth = pos.width;
var defaultX = pos.x;
var chart = prop.serializedObject.targetObject as BaseChart;
if (MakeComponentFoldout(prop, "m_Show", new HeaderMenuInfo("Reset|Reset to theme default color", () =>
if (MakeComponentFoldout(prop, "m_Show", false, new HeaderMenuInfo("Reset|Reset to theme default color", () =>
{
chart.theme.sharedTheme.ResetTheme();
chart.RefreshAllComponent();

View File

@@ -11,7 +11,7 @@ namespace XCharts.Editor
public override void OnGUI(Rect pos, SerializedProperty prop, GUIContent label)
{
base.OnGUI(pos, prop, label);
if (MakeComponentFoldout(prop, "m_Show"))
if (MakeComponentFoldout(prop, "m_Show", true))
{
++EditorGUI.indentLevel;
PropertyField(prop, "m_OffsetCenter");