AirControl  1.3.0
Open Source, Modular, and Extensible Flight Simulator For Deep Learning Research
VesselDrawer.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(Vessel), true)]
15  {
16  public override string ClassName { get { return "Vessel"; } }
17  public override void OnGUI(Rect pos, SerializedProperty prop, GUIContent label)
18  {
19  base.OnGUI(pos, prop, label);
20  if (MakeFoldout(prop, "m_Show"))
21  {
22  ++EditorGUI.indentLevel;
23  var shape = (Vessel.Shape)prop.FindPropertyRelative("m_Shape").intValue;
24  PropertyField(prop, "m_Shape");
25  PropertyField(prop, "m_ShapeWidth");
26  PropertyField(prop, "m_Gap");
27  PropertyTwoFiled(prop, "m_Center");
28  PropertyField(prop, "m_BackgroundColor");
29  PropertyField(prop, "m_Color");
30  PropertyField(prop, "m_AutoColor");
31  switch (shape)
32  {
33  case Vessel.Shape.Circle:
34  PropertyField(prop, "m_Radius");
35  PropertyField(prop, "m_Smoothness");
36  break;
37  case Vessel.Shape.Rect:
38  PropertyField(prop, "m_Width");
39  PropertyField(prop, "m_Height");
40  PropertyField(prop, "m_CornerRadius");
41  break;
42  }
43  --EditorGUI.indentLevel;
44  }
45  }
46  }
47 }
XCharts.BasePropertyDrawer
Definition: BasePropertyDrawer.cs:15
XCharts
Definition: RewardChart.cs:14
XCharts.Vessel.Shape
Shape
Definition: Vessel.cs:23
XCharts.SerieSymbolType.Rect
@ Rect
正方形。可通过设置itemStyle的cornerRadius变成圆角矩形。
XCharts.VesselDrawer
Definition: VesselDrawer.cs:14
XCharts.Vessel
Vessel component for liquid chart. There can be multiple vessels in a Chart, which can be matched by ...
Definition: Vessel.cs:21