2021-11-23 13:20:07 +08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
using UnityEditor;
|
|
|
|
|
using UnityEngine;
|
2022-02-19 22:37:57 +08:00
|
|
|
using XCharts.Runtime;
|
2021-11-23 13:20:07 +08:00
|
|
|
#if dUI_TextMeshPro
|
|
|
|
|
using TMPro;
|
|
|
|
|
#endif
|
|
|
|
|
|
2021-12-24 13:33:09 +08:00
|
|
|
namespace XCharts.Editor
|
2021-11-23 13:20:07 +08:00
|
|
|
{
|
|
|
|
|
[CustomEditor(typeof(Theme))]
|
2021-12-24 13:33:09 +08:00
|
|
|
public class ThemeEditor : UnityEditor.Editor
|
2021-11-23 13:20:07 +08:00
|
|
|
{
|
|
|
|
|
private Theme m_Theme;
|
|
|
|
|
void OnEnable()
|
|
|
|
|
{
|
|
|
|
|
m_Theme = target as Theme;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
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")))
|
|
|
|
|
{
|
|
|
|
|
m_Theme.ResetTheme();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|