2021-01-11 08:54:28 +08:00
|
|
|
|
/************************************************/
|
|
|
|
|
|
/* */
|
|
|
|
|
|
/* Copyright (c) 2018 - 2021 monitor1394 */
|
|
|
|
|
|
/* https://github.com/monitor1394 */
|
|
|
|
|
|
/* */
|
|
|
|
|
|
/************************************************/
|
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
|
2019-11-05 18:58:32 +08:00
|
|
|
|
|
|
|
|
|
|
namespace XCharts
|
|
|
|
|
|
{
|
|
|
|
|
|
[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);
|
|
|
|
|
|
if (MakeFoldout(prop, ""))
|
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");
|
|
|
|
|
|
PropertyField(prop, "m_Offset");
|
|
|
|
|
|
PropertyField(prop, "m_Color");
|
|
|
|
|
|
PropertyField(prop, "m_BackgroundColor");
|
|
|
|
|
|
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");
|
|
|
|
|
|
#endif
|
2020-02-13 09:23:30 +08:00
|
|
|
|
--EditorGUI.indentLevel;
|
|
|
|
|
|
}
|
2019-11-05 18:58:32 +08:00
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|