AirControl  1.3.0
Open Source, Modular, and Extensible Flight Simulator For Deep Learning Research
TextStyleDrawer.cs
1 /************************************************/
2 /* */
3 /* Copyright (c) 2018 - 2021 monitor1394 */
4 /* https://github.com/monitor1394 */
5 /* */
6 /************************************************/
7 
8 using UnityEditor;
9 using UnityEngine;
10 #if dUI_TextMeshPro
11 using TMPro;
12 #endif
13 
14 namespace XCharts
15 {
16  [CustomPropertyDrawer(typeof(TextStyle), true)]
18  {
19  public override string ClassName { get { return "TextStyle"; } }
20  public override void OnGUI(Rect pos, SerializedProperty prop, GUIContent label)
21  {
22  base.OnGUI(pos, prop, label);
23  if (MakeFoldout(prop, ""))
24  {
25  ++EditorGUI.indentLevel;
26 #if dUI_TextMeshPro
27  PropertyField(prop, "m_TMPFont");
28 #else
29  PropertyField(prop, "m_Font");
30 #endif
31  PropertyField(prop, "m_Rotate");
32  PropertyField(prop, "m_Offset");
33  PropertyField(prop, "m_Color");
34  PropertyField(prop, "m_BackgroundColor");
35  PropertyField(prop, "m_FontSize");
36  PropertyField(prop, "m_LineSpacing");
37 #if dUI_TextMeshPro
38  PropertyField(prop, "m_TMPFontStyle");
39  PropertyField(prop, "m_TMPAlignment");
40 #else
41  PropertyField(prop, "m_FontStyle");
42  PropertyField(prop, "m_Alignment");
43  PropertyField(prop, "m_AutoWrap");
44  PropertyField(prop, "m_AutoAlign");
45 #endif
46  --EditorGUI.indentLevel;
47  }
48  }
49  }
50 }
XCharts.BasePropertyDrawer
Definition: BasePropertyDrawer.cs:15
XCharts.TextStyleDrawer
Definition: TextStyleDrawer.cs:17
XCharts
Definition: RewardChart.cs:14
XCharts.SerieSymbolType.Rect
@ Rect
正方形。可通过设置itemStyle的cornerRadius变成圆角矩形。