2019-11-05 18:58:32 +08:00
|
|
|
using UnityEditor;
|
|
|
|
|
using UnityEngine;
|
2021-01-11 08:54:28 +08:00
|
|
|
#if dUI_TextMeshPro
|
|
|
|
|
using TMPro;
|
|
|
|
|
#endif
|
2022-02-19 22:37:57 +08:00
|
|
|
using XCharts.Runtime;
|
2019-11-05 18:58:32 +08:00
|
|
|
|
2021-12-24 13:33:09 +08:00
|
|
|
namespace XCharts.Editor
|
2019-11-05 18:58:32 +08:00
|
|
|
{
|
|
|
|
|
[CustomPropertyDrawer(typeof(TextStyle), true)]
|
2021-01-11 08:54:28 +08:00
|
|
|
public class TextStyleDrawer : BasePropertyDrawer
|
2019-11-05 18:58:32 +08:00
|
|
|
{
|
2021-01-11 08:54:28 +08:00
|
|
|
public override string ClassName { get { return "TextStyle"; } }
|
2019-11-05 18:58:32 +08:00
|
|
|
public override void OnGUI(Rect pos, SerializedProperty prop, GUIContent label)
|
|
|
|
|
{
|
2021-01-11 08:54:28 +08:00
|
|
|
base.OnGUI(pos, prop, label);
|
2022-04-26 08:24:45 +08:00
|
|
|
if (MakeComponentFoldout(prop, "m_Show", true))
|
2020-02-13 09:23:30 +08:00
|
|
|
{
|
|
|
|
|
++EditorGUI.indentLevel;
|
2021-01-11 08:54:28 +08:00
|
|
|
#if dUI_TextMeshPro
|
|
|
|
|
PropertyField(prop, "m_TMPFont");
|
|
|
|
|
#else
|
|
|
|
|
PropertyField(prop, "m_Font");
|
|
|
|
|
#endif
|
|
|
|
|
PropertyField(prop, "m_Rotate");
|
2022-03-29 22:06:10 +08:00
|
|
|
PropertyField(prop, "m_AutoColor");
|
2021-01-11 08:54:28 +08:00
|
|
|
PropertyField(prop, "m_Color");
|
|
|
|
|
PropertyField(prop, "m_FontSize");
|
|
|
|
|
PropertyField(prop, "m_LineSpacing");
|
|
|
|
|
#if dUI_TextMeshPro
|
|
|
|
|
PropertyField(prop, "m_TMPFontStyle");
|
|
|
|
|
PropertyField(prop, "m_TMPAlignment");
|
|
|
|
|
#else
|
|
|
|
|
PropertyField(prop, "m_FontStyle");
|
|
|
|
|
PropertyField(prop, "m_Alignment");
|
2021-05-25 08:06:32 +08:00
|
|
|
PropertyField(prop, "m_AutoAlign");
|
2022-04-26 08:24:45 +08:00
|
|
|
PropertyField(prop, "m_AutoWrap");
|
2021-01-11 08:54:28 +08:00
|
|
|
#endif
|
2020-02-13 09:23:30 +08:00
|
|
|
--EditorGUI.indentLevel;
|
|
|
|
|
}
|
2019-11-05 18:58:32 +08:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|