mirror of
https://github.com/XCharts-Team/XCharts.git
synced 2026-05-18 14:30:10 +00:00
3.0
This commit is contained in:
@@ -1,4 +1,3 @@
|
||||
|
||||
using UnityEditor;
|
||||
using UnityEngine;
|
||||
using XCharts.Runtime;
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
|
||||
using UnityEditor;
|
||||
using UnityEngine;
|
||||
using XCharts.Runtime;
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
|
||||
using System.Collections.Generic;
|
||||
using UnityEditor;
|
||||
using UnityEngine;
|
||||
@@ -110,7 +109,7 @@ namespace XCharts.Editor
|
||||
{
|
||||
if (IngorePropertys.Contains(relativePropName)) return;
|
||||
if (!ChartEditorHelper.PropertyFieldWithMinValue(ref m_DrawRect, m_Heights, m_KeyName, prop,
|
||||
relativePropName, minValue))
|
||||
relativePropName, minValue))
|
||||
{
|
||||
Debug.LogError("PropertyField ERROR:" + prop.displayName + ", " + relativePropName);
|
||||
}
|
||||
@@ -119,7 +118,7 @@ namespace XCharts.Editor
|
||||
{
|
||||
if (IngorePropertys.Contains(relativePropName)) return;
|
||||
if (!ChartEditorHelper.PropertyFieldWithMaxValue(ref m_DrawRect, m_Heights, m_KeyName, prop,
|
||||
relativePropName, maxValue))
|
||||
relativePropName, maxValue))
|
||||
{
|
||||
Debug.LogError("PropertyField ERROR:" + prop.displayName + ", " + relativePropName);
|
||||
}
|
||||
@@ -163,25 +162,40 @@ namespace XCharts.Editor
|
||||
}
|
||||
}
|
||||
protected bool MakeComponentFoldout(SerializedProperty prop, string relativePropName, bool relativePropEnable,
|
||||
params HeaderMenuInfo[] menus)
|
||||
params HeaderMenuInfo[] menus)
|
||||
{
|
||||
if (string.IsNullOrEmpty(relativePropName))
|
||||
{
|
||||
return ChartEditorHelper.MakeComponentFoldout(ref m_DrawRect, m_Heights, m_PropToggles, m_KeyName,
|
||||
m_DisplayName, null, relativePropEnable, menus);
|
||||
m_DisplayName, null, null, relativePropEnable, menus);
|
||||
}
|
||||
else
|
||||
{
|
||||
{
|
||||
var relativeProp = prop.FindPropertyRelative(relativePropName);
|
||||
return ChartEditorHelper.MakeComponentFoldout(ref m_DrawRect, m_Heights, m_PropToggles, m_KeyName,
|
||||
m_DisplayName, relativeProp, relativePropEnable, menus);
|
||||
m_DisplayName, relativeProp, null, relativePropEnable, menus);
|
||||
}
|
||||
}
|
||||
|
||||
protected virtual void DrawExtendeds(SerializedProperty prop)
|
||||
protected bool MakeComponentFoldout(SerializedProperty prop, string relativePropName, string relativePropName2,
|
||||
bool relativePropEnable, params HeaderMenuInfo[] menus)
|
||||
{
|
||||
if (string.IsNullOrEmpty(relativePropName))
|
||||
{
|
||||
return ChartEditorHelper.MakeComponentFoldout(ref m_DrawRect, m_Heights, m_PropToggles, m_KeyName,
|
||||
m_DisplayName, null, null, relativePropEnable, menus);
|
||||
}
|
||||
else
|
||||
{
|
||||
var relativeProp = prop.FindPropertyRelative(relativePropName);
|
||||
var relativeProp2 = prop.FindPropertyRelative(relativePropName2);
|
||||
return ChartEditorHelper.MakeComponentFoldout(ref m_DrawRect, m_Heights, m_PropToggles, m_KeyName,
|
||||
m_DisplayName, relativeProp, relativeProp2, relativePropEnable, menus);
|
||||
}
|
||||
}
|
||||
|
||||
protected virtual void DrawExtendeds(SerializedProperty prop) { }
|
||||
|
||||
public override float GetPropertyHeight(SerializedProperty prop, GUIContent label)
|
||||
{
|
||||
var key = GetKeyName(prop);
|
||||
|
||||
26
Editor/ChildComponents/CommentItemDrawer.cs
Normal file
26
Editor/ChildComponents/CommentItemDrawer.cs
Normal file
@@ -0,0 +1,26 @@
|
||||
using UnityEditor;
|
||||
using UnityEngine;
|
||||
using XCharts.Runtime;
|
||||
|
||||
namespace XCharts.Editor
|
||||
{
|
||||
[CustomPropertyDrawer(typeof(CommentItem), true)]
|
||||
public class CommentItemDrawer : BasePropertyDrawer
|
||||
{
|
||||
public override string ClassName { get { return "CommentItem"; } }
|
||||
public override void OnGUI(Rect pos, SerializedProperty prop, GUIContent label)
|
||||
{
|
||||
base.OnGUI(pos, prop, label);
|
||||
if (MakeComponentFoldout(prop, "m_Show", "m_Content", true))
|
||||
{
|
||||
++EditorGUI.indentLevel;
|
||||
PropertyField(prop, "m_Content");
|
||||
PropertyField(prop, "m_Position");
|
||||
//PropertyField(prop, "m_MarkRect");
|
||||
//PropertyField(prop, "m_MarkStyle");
|
||||
PropertyField(prop, "m_LabelStyle");
|
||||
--EditorGUI.indentLevel;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,5 +1,5 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 418b81a68e59a4572ab57787b5362d5a
|
||||
guid: d485d6a729a1449cdb5032f380fba70f
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
22
Editor/ChildComponents/CommentMarkStyleDrawer.cs
Normal file
22
Editor/ChildComponents/CommentMarkStyleDrawer.cs
Normal file
@@ -0,0 +1,22 @@
|
||||
using UnityEditor;
|
||||
using UnityEngine;
|
||||
using XCharts.Runtime;
|
||||
|
||||
namespace XCharts.Editor
|
||||
{
|
||||
[CustomPropertyDrawer(typeof(CommentMarkStyle), true)]
|
||||
public class CommentMarkStyleDrawer : BasePropertyDrawer
|
||||
{
|
||||
public override string ClassName { get { return "MarkStyle"; } }
|
||||
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_LineStyle");
|
||||
--EditorGUI.indentLevel;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
11
Editor/ChildComponents/CommentMarkStyleDrawer.cs.meta
Normal file
11
Editor/ChildComponents/CommentMarkStyleDrawer.cs.meta
Normal file
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: d74ed458b24774b129611ed816b6b6cd
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -1,4 +1,3 @@
|
||||
|
||||
using System.Collections.Generic;
|
||||
using UnityEditor;
|
||||
using UnityEngine;
|
||||
@@ -59,6 +58,7 @@ namespace XCharts.Editor
|
||||
{
|
||||
public override string ClassName { get { return "Axis"; } }
|
||||
}
|
||||
|
||||
[CustomPropertyDrawer(typeof(RadiusAxisTheme), true)]
|
||||
public class RadiusAxisThemeDrawer : BaseAxisThemeDrawer
|
||||
{
|
||||
@@ -67,8 +67,9 @@ namespace XCharts.Editor
|
||||
{
|
||||
get
|
||||
{
|
||||
return new List<string> {
|
||||
"m_TextBackgroundColor" ,
|
||||
return new List<string>
|
||||
{
|
||||
"m_TextBackgroundColor",
|
||||
"m_LineLength",
|
||||
"m_SplitLineLength",
|
||||
};
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
|
||||
using UnityEditor;
|
||||
using UnityEngine;
|
||||
using XCharts.Runtime;
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
|
||||
using System.Collections.Generic;
|
||||
using UnityEditor;
|
||||
using UnityEngine;
|
||||
@@ -23,4 +22,22 @@ namespace XCharts.Editor
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
[CustomPropertyDrawer(typeof(EmphasisItemStyle), true)]
|
||||
public class EmphasisItemStyleDrawer : ItemStyleDrawer
|
||||
{
|
||||
public override string ClassName { get { return "EmphasisItemStyle"; } }
|
||||
}
|
||||
|
||||
[CustomPropertyDrawer(typeof(EmphasisLabelStyle), true)]
|
||||
public class EmphasisLabelStyleDrawer : LabelStyleDrawer
|
||||
{
|
||||
public override string ClassName { get { return "EmphasisLabel"; } }
|
||||
}
|
||||
|
||||
[CustomPropertyDrawer(typeof(EmphasisLabelLine), true)]
|
||||
public class EmphasisLabelLineDrawer : LabelLineDrawer
|
||||
{
|
||||
public override string ClassName { get { return "EmphasisLabelLine"; } }
|
||||
}
|
||||
}
|
||||
@@ -1,4 +1,3 @@
|
||||
|
||||
using UnityEditor;
|
||||
using UnityEngine;
|
||||
using XCharts.Runtime;
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
|
||||
using UnityEditor;
|
||||
using UnityEngine;
|
||||
using XCharts.Runtime;
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
|
||||
using UnityEditor;
|
||||
using UnityEngine;
|
||||
using XCharts.Runtime;
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
|
||||
using UnityEditor;
|
||||
using UnityEngine;
|
||||
using XCharts.Runtime;
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
|
||||
using UnityEditor;
|
||||
using UnityEngine;
|
||||
using XCharts.Runtime;
|
||||
@@ -28,6 +27,7 @@ namespace XCharts.Editor
|
||||
PropertyField(prop, "m_Background");
|
||||
PropertyField(prop, "m_TextStyle");
|
||||
PropertyField(prop, "m_TextPadding");
|
||||
PropertyField(prop, "m_TextLimit");
|
||||
--EditorGUI.indentLevel;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
|
||||
using UnityEditor;
|
||||
using UnityEngine;
|
||||
using XCharts.Runtime;
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
|
||||
using UnityEditor;
|
||||
using UnityEngine;
|
||||
using XCharts.Runtime;
|
||||
@@ -24,7 +23,7 @@ namespace XCharts.Editor
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
[CustomPropertyDrawer(typeof(LineArrow), true)]
|
||||
public class LineArrowStyleDrawer : BasePropertyDrawer
|
||||
{
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
|
||||
using UnityEditor;
|
||||
using UnityEngine;
|
||||
using XCharts.Runtime;
|
||||
@@ -47,6 +46,7 @@ namespace XCharts.Editor
|
||||
PropertyField(prop, "m_AutoColor");
|
||||
}
|
||||
}
|
||||
|
||||
[CustomPropertyDrawer(typeof(AxisTick), true)]
|
||||
public class AxisTickDrawer : BaseLineDrawer
|
||||
{
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
|
||||
using UnityEditor;
|
||||
using UnityEngine;
|
||||
using XCharts.Runtime;
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
|
||||
using UnityEditor;
|
||||
using UnityEngine;
|
||||
using XCharts.Runtime;
|
||||
|
||||
@@ -1,25 +0,0 @@
|
||||
|
||||
using UnityEditor;
|
||||
using UnityEngine;
|
||||
using XCharts.Runtime;
|
||||
|
||||
namespace XCharts.Editor
|
||||
{
|
||||
[CustomPropertyDrawer(typeof(SerieDataBaseInfo), true)]
|
||||
public class SerieDataBaseInfoDrawer : BasePropertyDrawer
|
||||
{
|
||||
public override string ClassName { get { return "BaseInfo"; } }
|
||||
public override void OnGUI(Rect pos, SerializedProperty prop, GUIContent label)
|
||||
{
|
||||
base.OnGUI(pos, prop, label);
|
||||
if (MakeComponentFoldout(prop, "m_Show", false))
|
||||
{
|
||||
++EditorGUI.indentLevel;
|
||||
PropertyField(prop, "m_Ignore");
|
||||
PropertyField(prop, "m_Selected");
|
||||
PropertyField(prop, "m_Radius");
|
||||
--EditorGUI.indentLevel;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,4 +1,3 @@
|
||||
|
||||
using System.Collections.Generic;
|
||||
using UnityEditor;
|
||||
using UnityEngine;
|
||||
@@ -16,7 +15,7 @@ namespace XCharts.Editor
|
||||
if (MakeComponentFoldout(prop, "m_Show", true))
|
||||
{
|
||||
++EditorGUI.indentLevel;
|
||||
var type = (SymbolType)prop.FindPropertyRelative("m_Type").enumValueIndex;
|
||||
var type = (SymbolType) prop.FindPropertyRelative("m_Type").enumValueIndex;
|
||||
PropertyField(prop, "m_Type");
|
||||
if (type == SymbolType.Custom)
|
||||
{
|
||||
@@ -28,7 +27,7 @@ namespace XCharts.Editor
|
||||
}
|
||||
PropertyField(prop, "m_Gap");
|
||||
PropertyField(prop, "m_SizeType");
|
||||
switch ((SymbolSizeType)prop.FindPropertyRelative("m_SizeType").enumValueIndex)
|
||||
switch ((SymbolSizeType) prop.FindPropertyRelative("m_SizeType").enumValueIndex)
|
||||
{
|
||||
case SymbolSizeType.Custom:
|
||||
PropertyField(prop, "m_Size");
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
|
||||
using UnityEditor;
|
||||
using UnityEngine;
|
||||
using XCharts.Runtime;
|
||||
@@ -13,10 +12,10 @@ namespace XCharts.Editor
|
||||
{
|
||||
base.OnGUI(pos, prop, label);
|
||||
if (MakeComponentFoldout(prop, "m_Show", false, new HeaderMenuInfo("Reset", () =>
|
||||
{
|
||||
var chart = prop.serializedObject.targetObject as BaseChart;
|
||||
chart.settings.Reset();
|
||||
})))
|
||||
{
|
||||
var chart = prop.serializedObject.targetObject as BaseChart;
|
||||
chart.settings.Reset();
|
||||
})))
|
||||
{
|
||||
++EditorGUI.indentLevel;
|
||||
PropertyField(prop, "m_ReversePainter");
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
|
||||
using System.Collections.Generic;
|
||||
using UnityEditor;
|
||||
using UnityEngine;
|
||||
@@ -16,7 +15,7 @@ namespace XCharts.Editor
|
||||
if (MakeComponentFoldout(prop, "m_Show", true))
|
||||
{
|
||||
++EditorGUI.indentLevel;
|
||||
var type = (SymbolType)prop.FindPropertyRelative("m_Type").enumValueIndex;
|
||||
var type = (SymbolType) prop.FindPropertyRelative("m_Type").enumValueIndex;
|
||||
PropertyField(prop, "m_Type");
|
||||
if (type == SymbolType.Custom)
|
||||
{
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
|
||||
using UnityEditor;
|
||||
using UnityEngine;
|
||||
using XCharts.Runtime;
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
|
||||
using UnityEditor;
|
||||
using UnityEngine;
|
||||
using XCharts.Runtime;
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
|
||||
using UnityEditor;
|
||||
using UnityEngine;
|
||||
#if dUI_TextMeshPro
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
|
||||
using System.IO;
|
||||
using UnityEditor;
|
||||
using UnityEngine;
|
||||
@@ -20,17 +19,17 @@ namespace XCharts.Editor
|
||||
var defaultX = pos.x;
|
||||
var chart = prop.serializedObject.targetObject as BaseChart;
|
||||
if (MakeComponentFoldout(prop, "m_Show", false, new HeaderMenuInfo("Reset|Reset to theme default color", () =>
|
||||
{
|
||||
chart.theme.sharedTheme.ResetTheme();
|
||||
chart.RefreshAllComponent();
|
||||
}), new HeaderMenuInfo("Export|Export theme to asset for a new theme", () =>
|
||||
{
|
||||
ExportThemeWindow.target = chart;
|
||||
EditorWindow.GetWindow(typeof(ExportThemeWindow));
|
||||
}), new HeaderMenuInfo("Sync color to custom|Sync shared theme color to custom color", () =>
|
||||
{
|
||||
chart.theme.SyncSharedThemeColorToCustom();
|
||||
})))
|
||||
{
|
||||
chart.theme.sharedTheme.ResetTheme();
|
||||
chart.RefreshAllComponent();
|
||||
}), new HeaderMenuInfo("Export|Export theme to asset for a new theme", () =>
|
||||
{
|
||||
ExportThemeWindow.target = chart;
|
||||
EditorWindow.GetWindow(typeof(ExportThemeWindow));
|
||||
}), new HeaderMenuInfo("Sync color to custom|Sync shared theme color to custom color", () =>
|
||||
{
|
||||
chart.theme.SyncSharedThemeColorToCustom();
|
||||
})))
|
||||
{
|
||||
++EditorGUI.indentLevel;
|
||||
var chartNameList = XCThemeMgr.GetAllThemeNames();
|
||||
@@ -46,12 +45,12 @@ namespace XCharts.Editor
|
||||
PropertyField(prop, "m_SharedTheme");
|
||||
PropertyField(prop, "m_TransparentBackground");
|
||||
PropertyField(prop, "m_EnableCustomTheme");
|
||||
using (new EditorGUI.DisabledScope(!prop.FindPropertyRelative("m_EnableCustomTheme").boolValue))
|
||||
{
|
||||
PropertyField(prop, "m_CustomBackgroundColor");
|
||||
PropertyField(prop, "m_CustomColorPalette");
|
||||
}
|
||||
--EditorGUI.indentLevel;
|
||||
using(new EditorGUI.DisabledScope(!prop.FindPropertyRelative("m_EnableCustomTheme").boolValue))
|
||||
{
|
||||
PropertyField(prop, "m_CustomBackgroundColor");
|
||||
PropertyField(prop, "m_CustomColorPalette");
|
||||
}
|
||||
--EditorGUI.indentLevel;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -71,7 +70,7 @@ namespace XCharts.Editor
|
||||
private string m_ChartName;
|
||||
static void Init()
|
||||
{
|
||||
window = (ExportThemeWindow)EditorWindow.GetWindow(typeof(ExportThemeWindow), false, "Export Theme", true);
|
||||
window = (ExportThemeWindow) EditorWindow.GetWindow(typeof(ExportThemeWindow), false, "Export Theme", true);
|
||||
window.minSize = new Vector2(600, 50);
|
||||
window.maxSize = new Vector2(600, 50);
|
||||
window.Show();
|
||||
@@ -117,14 +116,14 @@ namespace XCharts.Editor
|
||||
}
|
||||
else if (IsAssetsExist(XCThemeMgr.GetThemeAssetPath(m_ChartName)))
|
||||
{
|
||||
ShowNotification(new GUIContent("ERROR:The asset is exist! \npath="
|
||||
+ XCThemeMgr.GetThemeAssetPath(m_ChartName)));
|
||||
ShowNotification(new GUIContent("ERROR:The asset is exist! \npath=" +
|
||||
XCThemeMgr.GetThemeAssetPath(m_ChartName)));
|
||||
}
|
||||
else
|
||||
{
|
||||
XCThemeMgr.ExportTheme(target.theme.sharedTheme, m_ChartName);
|
||||
ShowNotification(new GUIContent("SUCCESS:The theme is exported. \npath="
|
||||
+ XCThemeMgr.GetThemeAssetPath(m_ChartName)));
|
||||
ShowNotification(new GUIContent("SUCCESS:The theme is exported. \npath=" +
|
||||
XCThemeMgr.GetThemeAssetPath(m_ChartName)));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
using UnityEditor;
|
||||
using UnityEditor;
|
||||
using UnityEngine;
|
||||
using XCharts.Runtime;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user