v3.0.0-preivew8

This commit is contained in:
monitor1394
2022-04-26 08:24:45 +08:00
parent f11ee84517
commit 9dedc1db68
80 changed files with 1189 additions and 1307 deletions

View File

@@ -18,7 +18,7 @@ namespace XCharts.Editor
PropertyField(prop, "m_FoldSeries");
PropertyField(prop, "m_ShowDebugInfo");
PropertyField(prop, "m_ShowAllChartObject");
PropertyField(prop, "m_DebugInfoTextStyle");
PropertyField(prop, "m_LabelStyle");
--EditorGUI.indentLevel;
}
}

View File

@@ -18,6 +18,7 @@ namespace XCharts.Editor
PropertyField(prop, "m_Layer");
PropertyField(prop, "m_Align");
PropertyField(prop, "m_Sprite");
PropertyField(prop, "m_Type");
PropertyField(prop, "m_Color");
PropertyField(prop, "m_Width");
PropertyField(prop, "m_Height");

View File

@@ -0,0 +1,28 @@

using UnityEditor;
using UnityEngine;
using XCharts.Runtime;
namespace XCharts.Editor
{
[CustomPropertyDrawer(typeof(ImageStyle), true)]
public class ImageStyleDrawer : BasePropertyDrawer
{
public override string ClassName { get { return "ImageStyle"; } }
public override void OnGUI(Rect pos, SerializedProperty prop, GUIContent label)
{
base.OnGUI(pos, prop, label);
if (MakeComponentFoldout(prop, "m_Show", true))
{
++EditorGUI.indentLevel;
PropertyField(prop, "m_Sprite");
PropertyField(prop, "m_Type");
PropertyField(prop, "m_AutoColor");
PropertyField(prop, "m_Color");
PropertyField(prop, "m_Width");
PropertyField(prop, "m_Height");
--EditorGUI.indentLevel;
}
}
}
}

View File

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

View File

@@ -16,17 +16,18 @@ namespace XCharts.Editor
{
++EditorGUI.indentLevel;
PropertyField(prop, "m_Position");
PropertyField(prop, "m_Offset");
PropertyField(prop, "m_AutoOffset");
PropertyField(prop, "m_Rotate");
PropertyField(prop, "m_Distance");
PropertyField(prop, "m_Formatter");
PropertyField(prop, "m_NumericFormatter");
PropertyField(prop, "m_BackgroundWidth");
PropertyField(prop, "m_BackgroundHeight");
PropertyField(prop, "m_PaddingLeftRight");
PropertyField(prop, "m_PaddingTopBottom");
PropertyField(prop, "m_AutoOffset");
PropertyField(prop, "m_Offset");
PropertyField(prop, "m_Distance");
PropertyField(prop, "m_Rotate");
PropertyField(prop, "m_Width");
PropertyField(prop, "m_Height");
PropertyField(prop, "m_Icon");
PropertyField(prop, "m_Background");
PropertyField(prop, "m_TextStyle");
PropertyField(prop, "m_TextPadding");
--EditorGUI.indentLevel;
}
}
@@ -35,6 +36,6 @@ namespace XCharts.Editor
[CustomPropertyDrawer(typeof(EndLabelStyle), true)]
public class EndLabelStyleDrawer : LabelStyleDrawer
{
public override string ClassName { get { return "EndLabel"; } }
public override string ClassName { get { return "End Label"; } }
}
}

View File

@@ -0,0 +1,26 @@

using UnityEditor;
using UnityEngine;
using XCharts.Runtime;
namespace XCharts.Editor
{
[CustomPropertyDrawer(typeof(TextPadding), true)]
public class TextPaddingDrawer : BasePropertyDrawer
{
public override string ClassName { get { return "Padding"; } }
public override void OnGUI(Rect pos, SerializedProperty prop, GUIContent label)
{
base.OnGUI(pos, prop, label);
if (MakeComponentFoldout(prop, "m_Show", true))
{
++EditorGUI.indentLevel;
PropertyField(prop, "m_Top");
PropertyField(prop, "m_Right");
PropertyField(prop, "m_Bottom");
PropertyField(prop, "m_Left");
--EditorGUI.indentLevel;
}
}
}
}

View File

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

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, "", true))
if (MakeComponentFoldout(prop, "m_Show", true))
{
++EditorGUI.indentLevel;
#if dUI_TextMeshPro
@@ -24,12 +24,8 @@ namespace XCharts.Editor
PropertyField(prop, "m_Font");
#endif
PropertyField(prop, "m_Rotate");
PropertyField(prop, "m_Offset");
PropertyField(prop, "m_ExtraWidth");
PropertyField(prop, "m_AutoColor");
PropertyField(prop, "m_Color");
PropertyField(prop, "m_AutoBackgroundColor");
PropertyField(prop, "m_BackgroundColor");
PropertyField(prop, "m_FontSize");
PropertyField(prop, "m_LineSpacing");
#if dUI_TextMeshPro
@@ -38,8 +34,8 @@ namespace XCharts.Editor
#else
PropertyField(prop, "m_FontStyle");
PropertyField(prop, "m_Alignment");
PropertyField(prop, "m_AutoWrap");
PropertyField(prop, "m_AutoAlign");
PropertyField(prop, "m_AutoWrap");
#endif
--EditorGUI.indentLevel;
}

View File

@@ -5,19 +5,8 @@ using XCharts.Runtime;
namespace XCharts.Editor
{
[CustomPropertyDrawer(typeof(TitleStyle), true)]
public class TitleStyleDrawer : BasePropertyDrawer
public class TitleStyleDrawer : LabelStyleDrawer
{
public override string ClassName { get { return "TitleStyle"; } }
public override void OnGUI(Rect pos, SerializedProperty prop, GUIContent label)
{
base.OnGUI(pos, prop, label);
if (MakeComponentFoldout(prop, "m_Show", true))
{
++EditorGUI.indentLevel;
PropertyField(prop, "m_OffsetCenter");
PropertyField(prop, "m_TextStyle");
--EditorGUI.indentLevel;
}
}
}
}

View File

@@ -80,7 +80,6 @@ namespace XCharts.Editor
PropertyField("m_AxisLabel");
PropertyField("m_SplitLine");
PropertyField("m_SplitArea");
PropertyField("m_IconStyle");
PropertyListField("m_Icons", true);
if (type == Axis.AxisType.Category)
{
@@ -153,17 +152,22 @@ namespace XCharts.Editor
++EditorGUI.indentLevel;
PropertyField(prop, "m_Inside");
PropertyField(prop, "m_Interval");
PropertyField(prop, "m_Distance");
PropertyField(prop, "m_Width");
PropertyField(prop, "m_Height");
PropertyField(prop, "m_Formatter");
PropertyField(prop, "m_NumericFormatter");
PropertyField(prop, "m_ShowAsPositiveNumber");
PropertyField(prop, "m_OnZero");
PropertyField(prop, "m_ShowStartLabel");
PropertyField(prop, "m_ShowEndLabel");
PropertyField(prop, "m_TextLimit");
PropertyField(prop, "m_Rotate");
PropertyField(prop, "m_Distance");
PropertyField(prop, "m_Formatter");
PropertyField(prop, "m_NumericFormatter");
PropertyField(prop, "m_Width");
PropertyField(prop, "m_Height");
PropertyField(prop, "m_Icon");
PropertyField(prop, "m_Background");
PropertyField(prop, "m_TextStyle");
PropertyField(prop, "m_Padding");
--EditorGUI.indentLevel;
}
}
@@ -180,9 +184,7 @@ namespace XCharts.Editor
{
++EditorGUI.indentLevel;
PropertyField(prop, "m_Name");
PropertyField(prop, "m_Formatter");
PropertyField(prop, "m_Location");
PropertyField(prop, "m_TextStyle");
PropertyField(prop, "m_LabelStyle");
--EditorGUI.indentLevel;
}
}

View File

@@ -46,9 +46,9 @@ namespace XCharts.Editor
PropertyField("m_Bottom");
PropertyField("m_LineStyle");
PropertyField("m_AreaStyle");
PropertyField("m_LabelStyle");
PropertyListField("m_XAxisIndexs", true);
PropertyListField("m_YAxisIndexs", true);
PropertyField("m_TextStyle");
}
else
{

View File

@@ -19,7 +19,7 @@ namespace XCharts.Editor
PropertyField("m_Orient");
PropertyField("m_Formatter");
PropertyField("m_Location");
PropertyField("m_TextStyle");
PropertyField("m_LabelStyle");
PropertyListField("m_Icons");
PropertyListField("m_Data");
--EditorGUI.indentLevel;

View File

@@ -14,8 +14,8 @@ namespace XCharts.Editor
PropertyField("m_SubText");
PropertyField("m_ItemGap");
PropertyField("m_Location");
PropertyField("m_TextStyle");
PropertyField("m_SubTextStyle");
PropertyField("m_LabelStyle");
PropertyField("m_SubLabelStyle");
--EditorGUI.indentLevel;
}
}

View File

@@ -17,10 +17,10 @@ namespace XCharts.Editor
PropertyField("m_TitleFormatter");
PropertyField("m_ItemFormatter");
PropertyField("m_NumericFormatter");
PropertyField("m_TitleHeight");
PropertyField("m_ItemHeight");
PropertyFiledMore(() =>
{
PropertyField("m_TitleHeight");
PropertyField("m_ItemHeight");
PropertyField("m_Marker");
PropertyField("m_BorderWidth");
PropertyField("m_BorderColor");
@@ -40,9 +40,9 @@ namespace XCharts.Editor
PropertyField("m_FixedY");
});
PropertyField("m_LineStyle");
PropertyField("m_LabelTextStyle");
PropertyField("m_TitleTextStyle");
PropertyListField("m_ColumnsTextStyle");
PropertyField("m_IndicatorLabelStyle");
PropertyField("m_TitleLabelStyle");
PropertyListField("m_ContentLabelStyles");
--EditorGUI.indentLevel;
}
}

View File

@@ -195,7 +195,6 @@ namespace XCharts.Editor
var m_Id = serieData.FindPropertyRelative("m_Id");
var m_ParentId = serieData.FindPropertyRelative("m_ParentId");
var m_IconStyle = serieData.FindPropertyRelative("m_IconStyles");
var m_Label = serieData.FindPropertyRelative("m_Labels");
var m_ItemStyle = serieData.FindPropertyRelative("m_ItemStyles");
var m_Emphasis = serieData.FindPropertyRelative("m_Emphases");
@@ -208,7 +207,7 @@ namespace XCharts.Editor
PropertyField(m_Id);
PropertyField(m_ParentId);
var componentNum = m_IconStyle.arraySize + m_Label.arraySize + m_ItemStyle.arraySize + m_Emphasis.arraySize
var componentNum = m_Label.arraySize + m_ItemStyle.arraySize + m_Emphasis.arraySize
+ m_Symbol.arraySize + m_LineStyle.arraySize + m_AreaStyle.arraySize;
var title = "Component";
if (componentNum == 0) title += " (None)";
@@ -217,10 +216,6 @@ namespace XCharts.Editor
{
serie.GetSerieData(index).GetOrAddComponent<ItemStyle>();
}, m_ItemStyle.arraySize == 0),
new HeaderMenuInfo("Add IconStyle", () =>
{
serie.GetSerieData(index).GetOrAddComponent<IconStyle>();
}, m_IconStyle.arraySize == 0),
new HeaderMenuInfo("Add Label", () =>
{
serie.GetSerieData(index).GetOrAddComponent<LabelStyle>();
@@ -249,10 +244,6 @@ namespace XCharts.Editor
{
serie.GetSerieData(index).RemoveComponent<ItemStyle>();
}, m_ItemStyle.arraySize > 0),
new HeaderMenuInfo("Remove IconStyle", () =>
{
serie.GetSerieData(index).RemoveComponent<IconStyle>();
}, m_IconStyle.arraySize > 0),
new HeaderMenuInfo("Remove Label", () =>
{
serie.GetSerieData(index).RemoveComponent<LabelStyle>();
@@ -283,8 +274,6 @@ namespace XCharts.Editor
}, componentNum > 0));
if (m_DataComponentFoldout)
{
if (m_IconStyle.arraySize > 0)
PropertyField(m_IconStyle.GetArrayElementAtIndex(0));
if (m_Label.arraySize > 0)
PropertyField(m_Label.GetArrayElementAtIndex(0));
if (m_ItemStyle.arraySize > 0)