AirControl  1.3.0
Open Source, Modular, and Extensible Flight Simulator For Deep Learning Research
VisualMapDrawer.cs
1 /************************************************/
2 /* */
3 /* Copyright (c) 2018 - 2021 monitor1394 */
4 /* https://github.com/monitor1394 */
5 /* */
6 /************************************************/
7 
8 using UnityEditor;
9 using UnityEngine;
10 
11 namespace XCharts
12 {
13  [CustomPropertyDrawer(typeof(VisualMap), true)]
15  {
16  public override string ClassName { get { return "VisualMap"; } }
17  public override void OnGUI(Rect pos, SerializedProperty prop, GUIContent label)
18  {
19  base.OnGUI(pos, prop, label);
20  if (MakeFoldout(prop, "m_Enable"))
21  {
22  ++EditorGUI.indentLevel;
23  var type = (VisualMap.Type)prop.FindPropertyRelative("m_Type").enumValueIndex;
24  var isPiece = type == VisualMap.Type.Piecewise;
25  PropertyField(prop, "m_Type");
26  PropertyField(prop, "m_AutoMinMax");
27  PropertyField(prop, "m_Min");
28  PropertyField(prop, "m_Max");
29  PropertyField(prop, "m_SplitNumber");
30  PropertyField(prop, "m_Dimension");
31  PropertyListField(prop, "m_OutOfRange");
32  PropertyListField(prop, isPiece ? "m_Pieces" : "m_InRange");
33  PropertyField(prop, "m_Show");
34  if (prop.FindPropertyRelative("m_Show").boolValue)
35  {
36  PropertyField(prop, "m_SelectedMode");
37  PropertyTwoFiled(prop, "m_Range");
38  PropertyTwoFiled(prop, "m_Text");
39  PropertyTwoFiled(prop, "m_TextGap");
40  PropertyField(prop, "m_HoverLink");
41  PropertyField(prop, "m_Calculable");
42  PropertyField(prop, "m_ItemWidth");
43  PropertyField(prop, "m_ItemHeight");
44  if (isPiece) PropertyField(prop, "m_ItemGap");
45  PropertyField(prop, "m_BorderWidth");
46  PropertyField(prop, "m_Orient");
47  PropertyField(prop, "m_Location");
48  }
49  --EditorGUI.indentLevel;
50  }
51  }
52  }
53 
54  [CustomPropertyDrawer(typeof(VisualMap.Pieces), true)]
56  {
57  public override string ClassName { get { return "Pieces"; } }
58  public override void OnGUI(Rect pos, SerializedProperty prop, GUIContent label)
59  {
60  base.OnGUI(pos, prop, label);
61  if (MakeFoldout(prop, ""))
62  {
63  ++EditorGUI.indentLevel;
64  PropertyField(prop, "m_Min");
65  PropertyField(prop, "m_Max");
66  PropertyField(prop, "m_Label");
67  PropertyField(prop, "m_Color");
68  --EditorGUI.indentLevel;
69  }
70  }
71  }
72 }
XCharts.BasePropertyDrawer
Definition: BasePropertyDrawer.cs:15
XCharts.PiecesDrawer
Definition: VisualMapDrawer.cs:55
XCharts.VisualMap
VisualMap component. Mapping data to visual elements such as colors. 视觉映射组件。用于进行『视觉编码』,也就是将数据映射到视觉元素(...
Definition: VisualMap.cs:21
XCharts.VisualMap.Pieces
Definition: VisualMap.cs:54
XCharts.VisualMapDrawer
Definition: VisualMapDrawer.cs:14
XCharts
Definition: RewardChart.cs:14
XCharts.VisualMap.Type
Type
类型。分为连续型和分段型。
Definition: VisualMap.cs:26
XCharts.SerieSymbolType.Rect
@ Rect
正方形。可通过设置itemStyle的cornerRadius变成圆角矩形。