This commit is contained in:
monitor1394
2022-05-22 22:17:38 +08:00
parent 003f4da9de
commit bafe032bb9
391 changed files with 3718 additions and 2774 deletions

View File

@@ -1,4 +1,3 @@
using UnityEditor;
using UnityEngine;
using XCharts.Runtime;
@@ -13,7 +12,7 @@ namespace XCharts.Editor
var m_Type = baseProperty.FindPropertyRelative("m_Type");
var m_LogBase = baseProperty.FindPropertyRelative("m_LogBase");
var m_MinMaxType = baseProperty.FindPropertyRelative("m_MinMaxType");
var type = (Axis.AxisType)m_Type.enumValueIndex;
var type = (Axis.AxisType) m_Type.enumValueIndex;
EditorGUI.indentLevel++;
if (component is ParallelAxis)
{
@@ -41,7 +40,7 @@ namespace XCharts.Editor
if (type == Axis.AxisType.Value || type == Axis.AxisType.Time)
{
PropertyField("m_MinMaxType");
Axis.AxisMinMaxType minMaxType = (Axis.AxisMinMaxType)m_MinMaxType.enumValueIndex;
Axis.AxisMinMaxType minMaxType = (Axis.AxisMinMaxType) m_MinMaxType.enumValueIndex;
switch (minMaxType)
{
case Axis.AxisMinMaxType.Default:
@@ -95,13 +94,11 @@ namespace XCharts.Editor
[ComponentEditor(typeof(XAxis))]
public class XAxisEditor : AxisEditor
{
}
{ }
[ComponentEditor(typeof(YAxis))]
public class YAxisEditor : AxisEditor
{
}
{ }
[ComponentEditor(typeof(SingleAxis))]
public class SingleAxisEditor : AxisEditor
@@ -132,13 +129,11 @@ namespace XCharts.Editor
[ComponentEditor(typeof(RadiusAxis))]
public class RadiusAxisEditor : AxisEditor
{
}
{ }
[ComponentEditor(typeof(ParallelAxis))]
public class ParallelAxisEditor : AxisEditor
{
}
{ }
[CustomPropertyDrawer(typeof(AxisLabel), true)]
public class AxisLabelDrawer : BasePropertyDrawer
@@ -159,6 +154,7 @@ namespace XCharts.Editor
PropertyField(prop, "m_ShowEndLabel");
PropertyField(prop, "m_Rotate");
PropertyField(prop, "m_Offset");
PropertyField(prop, "m_Distance");
PropertyField(prop, "m_Formatter");
PropertyField(prop, "m_NumericFormatter");
@@ -168,6 +164,7 @@ namespace XCharts.Editor
PropertyField(prop, "m_Background");
PropertyField(prop, "m_TextStyle");
PropertyField(prop, "m_TextPadding");
PropertyField(prop, "m_TextLimit");
--EditorGUI.indentLevel;
}
}

View File

@@ -1,5 +1,3 @@
using UnityEditor;
using XCharts.Runtime;

View File

@@ -0,0 +1,18 @@
using UnityEditor;
using XCharts.Runtime;
namespace XCharts.Editor
{
[ComponentEditor(typeof(Comment))]
public class CommentEditor : MainComponentEditor<Comment>
{
public override void OnInspectorGUI()
{
++EditorGUI.indentLevel;
PropertyField("m_LabelStyle");
//PropertyField("m_MarkStyle");
PropertyListField("m_Items", true);
--EditorGUI.indentLevel;
}
}
}

View File

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

View File

@@ -1,4 +1,3 @@
using UnityEditor;
using XCharts.Runtime;

View File

@@ -1,4 +1,3 @@
using UnityEditor;
using XCharts.Runtime;

View File

@@ -1,4 +1,3 @@
using UnityEditor;
using XCharts.Runtime;
@@ -15,12 +14,14 @@ namespace XCharts.Editor
PropertyField("m_ItemHeight");
PropertyField("m_ItemGap");
PropertyField("m_ItemAutoColor");
PropertyField("m_ItemOpacity");
PropertyField("m_SelectedMode");
PropertyField("m_Orient");
PropertyField("m_Formatter");
PropertyField("m_Location");
PropertyField("m_LabelStyle");
PropertyListField("m_Icons");
PropertyListField("m_Colors");
PropertyListField("m_Data");
--EditorGUI.indentLevel;
}

View File

@@ -1,4 +1,3 @@
using UnityEditor;
using UnityEngine;
using UnityEngine.Assertions;
@@ -28,12 +27,10 @@ namespace XCharts.Editor
}
public virtual void OnEnable()
{
}
{ }
public virtual void OnDisable()
{
}
{ }
internal void OnInternalInspectorGUI()
{
@@ -42,12 +39,10 @@ namespace XCharts.Editor
}
public virtual void OnInspectorGUI()
{
}
{ }
protected virtual void DrawExtendeds()
{
}
{ }
public virtual string GetDisplayTitle()
{

View File

@@ -1,10 +1,8 @@
using XCharts.Runtime;
namespace XCharts.Editor
{
public class MainComponentEditor<T> : MainComponentBaseEditor
where T : MainComponent
{
}
where T : MainComponent
{ }
}

View File

@@ -1,9 +1,8 @@
using System;
using System.Collections.Generic;
using UnityEngine.Assertions;
using UnityEditor;
using System.Linq;
using UnityEditor;
using UnityEngine.Assertions;
using XCharts.Runtime;
namespace XCharts.Editor
@@ -84,7 +83,7 @@ namespace XCharts.Editor
editor.showProperty,
() => { ResetComponentEditor(id); },
() => { RemoveComponentEditor(id); }
);
);
if (displayContent)
{
editor.OnInternalInspectorGUI();
@@ -120,7 +119,7 @@ namespace XCharts.Editor
if (!m_EditorTypes.TryGetValue(settingsType, out editorType))
editorType = typeof(MainComponentBaseEditor);
var editor = (MainComponentBaseEditor)Activator.CreateInstance(editorType);
var editor = (MainComponentBaseEditor) Activator.CreateInstance(editorType);
editor.Init(chart, component, property, m_BaseEditor);
if (index < 0)

View File

@@ -1,4 +1,3 @@
using UnityEditor;
using UnityEngine;
using XCharts.Runtime;
@@ -31,7 +30,7 @@ namespace XCharts.Editor
if (MakeComponentFoldout(prop, "", true))
{
++EditorGUI.indentLevel;
var type = (MarkAreaType)(prop.FindPropertyRelative("m_Type")).enumValueIndex;
var type = (MarkAreaType) (prop.FindPropertyRelative("m_Type")).enumValueIndex;
PropertyField(prop, "m_Type");
PropertyField(prop, "m_Name");
switch (type)

View File

@@ -1,4 +1,3 @@
using UnityEditor;
using UnityEngine;
using XCharts.Runtime;
@@ -28,7 +27,7 @@ namespace XCharts.Editor
if (MakeComponentFoldout(prop, "", true))
{
++EditorGUI.indentLevel;
var type = (MarkLineType)(prop.FindPropertyRelative("m_Type")).enumValueIndex;
var type = (MarkLineType) (prop.FindPropertyRelative("m_Type")).enumValueIndex;
var group = prop.FindPropertyRelative("m_Group").intValue;
PropertyField(prop, "m_Type");
PropertyField(prop, "m_Name");

View File

@@ -1,4 +1,3 @@
using UnityEditor;
using XCharts.Runtime;

View File

@@ -1,4 +1,3 @@
using UnityEditor;
using XCharts.Runtime;

View File

@@ -1,4 +1,3 @@
using UnityEditor;
using UnityEngine;
using XCharts.Runtime;

View File

@@ -1,5 +1,3 @@
using UnityEditor;
using UnityEngine;
using XCharts.Runtime;
@@ -12,7 +10,14 @@ namespace XCharts.Editor
[CustomEditor(typeof(Theme))]
public class ThemeEditor : UnityEditor.Editor
{
static class Styles
{
internal static GUIContent btnReset = new GUIContent("Reset", "Reset to default theme");
internal static GUIContent btnSync = new GUIContent("Sync Font", "Sync main theme font to sub theme font");
}
private Theme m_Theme;
void OnEnable()
{
m_Theme = target as Theme;
@@ -20,15 +25,15 @@ namespace XCharts.Editor
public override void OnInspectorGUI()
{
// serializedObject.Update();
// EditorGUILayout.PropertyField(m_BackgroundColor);
// EditorGUILayout.PropertyField(m_ColorPalette);
// serializedObject.ApplyModifiedProperties();
base.OnInspectorGUI();
if (GUILayout.Button(new GUIContent("Reset", "Reset to default theme")))
if (GUILayout.Button(Styles.btnReset))
{
m_Theme.ResetTheme();
}
if (GUILayout.Button(Styles.btnSync))
{
m_Theme.SyncFontToSubComponent();
}
}
}
}

View File

@@ -1,4 +1,3 @@
using UnityEditor;
using XCharts.Runtime;

View File

@@ -1,4 +1,3 @@
using UnityEditor;
using XCharts.Runtime;

View File

@@ -1,4 +1,3 @@
using UnityEditor;
using UnityEngine;
using XCharts.Runtime;
@@ -11,7 +10,7 @@ namespace XCharts.Editor
public override void OnInspectorGUI()
{
++EditorGUI.indentLevel;
var type = (VisualMap.Type)baseProperty.FindPropertyRelative("m_Type").enumValueIndex;
var type = (VisualMap.Type) baseProperty.FindPropertyRelative("m_Type").enumValueIndex;
var isPiece = type == VisualMap.Type.Piecewise;
PropertyField("m_Type");
PropertyField("m_SerieIndex");
@@ -39,19 +38,19 @@ namespace XCharts.Editor
PropertyField("m_Location");
}
PropertyListField("m_OutOfRange");
PropertyListField(isPiece ? "m_Pieces" : "m_InRange");
PropertyListField("m_InRange");
--EditorGUI.indentLevel;
}
}
[CustomPropertyDrawer(typeof(VisualMapPieces), true)]
public class PiecesDrawer : BasePropertyDrawer
[CustomPropertyDrawer(typeof(VisualMapRange), true)]
public class VisualMapRangeDrawer : BasePropertyDrawer
{
public override string ClassName { get { return "Pieces"; } }
public override string ClassName { get { return "Range"; } }
public override void OnGUI(Rect pos, SerializedProperty prop, GUIContent label)
{
base.OnGUI(pos, prop, label);
if (MakeFoldout(prop, ""))
if (MakeFoldout(prop, "m_Color"))
{
++EditorGUI.indentLevel;
PropertyField(prop, "m_Min");