AirControl  1.3.0
Open Source, Modular, and Extensible Flight Simulator For Deep Learning Research
Vessel.cs
1 /************************************************/
2 /* */
3 /* Copyright (c) 2018 - 2021 monitor1394 */
4 /* https://github.com/monitor1394 */
5 /* */
6 /************************************************/
7 
8 using System;
9 using UnityEngine;
10 
11 namespace XCharts
12 {
20  [Serializable]
21  public class Vessel : MainComponent
22  {
23  public enum Shape
24  {
28  Circle,
32  Rect,
36  Triangle,
40  Diamond,
44  None,
45  }
46  [SerializeField] private bool m_Show = true;
47  [SerializeField] private Shape m_Shape = Shape.Circle;
48  [SerializeField] private float m_ShapeWidth = 5f;
49  [SerializeField] private float m_Gap = 5f;
50  [SerializeField] private Color32 m_Color;
51  [SerializeField] private Color32 m_BackgroundColor;
52  [SerializeField] private bool m_AutoColor = true;
53  [SerializeField] private float[] m_Center = new float[2] { 0.5f, 0.5f };
54  [SerializeField] private float m_Radius = 0.35f;
55  [SerializeField] [Range(0.5f, 10f)] private float m_Smoothness = 1f;
56  [SerializeField] private float m_Width = 0.5f;
57  [SerializeField] private float m_Height = 0.7f;
58  [SerializeField] private float[] m_CornerRadius = new float[] { 0, 0, 0, 0 };
59 
65  public bool show
66  {
67  get { return m_Show; }
68  set { if (PropertyUtil.SetStruct(ref m_Show, value)) SetVerticesDirty(); }
69  }
75  public Shape shape
76  {
77  get { return m_Shape; }
78  set { if (PropertyUtil.SetStruct(ref m_Shape, value)) SetVerticesDirty(); }
79  }
85  public float shapeWidth
86  {
87  get { return m_ShapeWidth; }
88  set { if (PropertyUtil.SetStruct(ref m_ShapeWidth, value)) SetVerticesDirty(); }
89  }
95  public float gap
96  {
97  get { return m_Gap; }
98  set { if (PropertyUtil.SetStruct(ref m_Gap, value)) SetVerticesDirty(); }
99  }
107  public float[] center
108  {
109  get { return m_Center; }
110  set { if (value != null) { m_Center = value; SetAllDirty(); } }
111  }
118  public float radius
119  {
120  get { return m_Radius; }
121  set { if (PropertyUtil.SetStruct(ref m_Radius, value)) SetAllDirty(); }
122  }
129  public float width
130  {
131  get { return m_Width; }
132  set { if (PropertyUtil.SetStruct(ref m_Width, value)) SetAllDirty(); }
133  }
140  public float height
141  {
142  get { return m_Height; }
143  set { if (PropertyUtil.SetStruct(ref m_Height, value)) SetAllDirty(); }
144  }
150  public float smoothness
151  {
152  get { return m_Smoothness; }
153  set { if (PropertyUtil.SetStruct(ref m_Smoothness, value)) SetAllDirty(); }
154  }
160  public Color32 backgroundColor
161  {
162  get { return m_BackgroundColor; }
163  set { if (PropertyUtil.SetColor(ref m_BackgroundColor, value)) SetVerticesDirty(); }
164  }
169  public Color32 color
170  {
171  get { return m_Color; }
172  set { if (PropertyUtil.SetColor(ref m_Color, value)) SetVerticesDirty(); }
173  }
179  public bool autoColor
180  {
181  get { return m_AutoColor; }
182  set { if (PropertyUtil.SetStruct(ref m_AutoColor, value)) SetVerticesDirty(); }
183  }
188  public float[] cornerRadius
189  {
190  get { return m_CornerRadius; }
191  set { if (PropertyUtil.SetClass(ref m_CornerRadius, value, true)) SetVerticesDirty(); }
192  }
193  public int index { get; internal set; }
198  public Vector3 runtimeCenterPos { get; internal set; }
203  public float runtimeRadius { get; internal set; }
208  public float runtimeInnerRadius { get; internal set; }
209  public float runtimeWidth { get; set; }
210  public float runtimeHeight { get; set; }
211  public static Vessel defaultVessel
212  {
213  get
214  {
215  var vessel = new Vessel
216  {
217  m_Show = true,
218  m_Shape = Shape.Circle,
219  m_ShapeWidth = 5,
220  m_Gap = 5,
221  m_Radius = 0.35f,
222  m_Width = 0.5f,
223  m_Height = 0.7f,
224  m_AutoColor = true,
225  m_Color = new Color32(70, 70, 240, 255),
226  m_Smoothness = 1
227  };
228  vessel.center[0] = 0.5f;
229  vessel.center[1] = 0.45f;
230  return vessel;
231  }
232  }
233  }
234 }
XCharts.Vessel.shape
Shape shape
The shape of vessel. 容器形状。 [default: Shape.Circle]
Definition: Vessel.cs:76
XCharts.Vessel.radius
float radius
The radius of vessel. When value between 0 and 1 represents a percentage relative to the chart....
Definition: Vessel.cs:119
XCharts.Vessel.center
float[] center
The center of vesselß. The center[0] is the x-coordinate, and the center[1] is the y-coordinate....
Definition: Vessel.cs:108
XCharts.SerieSymbolType.Circle
@ Circle
圆形。
XCharts.MainComponent
Definition: ChartComponent.cs:67
XCharts.Vessel.cornerRadius
float[] cornerRadius
The radius of rounded corner. Its unit is px. Use array to respectively specify the 4 corner radiuses...
Definition: Vessel.cs:189
XCharts.RoseType.None
@ None
Don't show as Nightingale chart.不展示成南丁格尔玫瑰图
XCharts.Vessel.runtimeRadius
float runtimeRadius
the runtime radius of vessel. 运行时半径。
Definition: Vessel.cs:203
XCharts.Vessel.runtimeInnerRadius
float runtimeInnerRadius
The actual radius after deducting shapeWidth and gap. 运行时内半径。扣除厚度和间隙后的实际半径。
Definition: Vessel.cs:208
XCharts
Definition: RewardChart.cs:14
XCharts.Vessel.runtimeCenterPos
Vector3 runtimeCenterPos
the runtime center position of vessel. 运行时中心点。
Definition: Vessel.cs:198
XCharts.Vessel.autoColor
bool autoColor
Whether automatic color. If true, the color matches serie. 是否自动颜色。为true时颜色会和serie一致。 [default: true]
Definition: Vessel.cs:180
XCharts.SerieSymbolType.Diamond
@ Diamond
菱形。
XCharts.Vessel.width
float width
The width of vessel. When value between 0 and 1 represents a percentage relative to the chart....
Definition: Vessel.cs:130
XCharts.Vessel.backgroundColor
Color32 backgroundColor
Background color of polar, which is transparent by default. 背景色,默认透明。 [default: Color....
Definition: Vessel.cs:161
XCharts.Vessel.smoothness
float smoothness
The smoothness of wave. 水波平滑度。 [default: 1f]
Definition: Vessel.cs:151
XCharts.Vessel.show
bool show
Whether to show the vessel. 是否显示容器组件。 [defaut: true]
Definition: Vessel.cs:66
XCharts.Vessel.shapeWidth
float shapeWidth
Thickness of vessel. 容器厚度。 [defaut: 5f]
Definition: Vessel.cs:86
XCharts.Vessel.Shape
Shape
Definition: Vessel.cs:23
XCharts.SerieSymbolType.Triangle
@ Triangle
三角形。
XCharts.SerieSymbolType.Rect
@ Rect
正方形。可通过设置itemStyle的cornerRadius变成圆角矩形。
XCharts.Vessel.height
float height
The height of vessel. When value between 0 and 1 represents a percentage relative to the chart....
Definition: Vessel.cs:141
XCharts.Vessel
Vessel component for liquid chart. There can be multiple vessels in a Chart, which can be matched by ...
Definition: Vessel.cs:21
XCharts.Vessel.color
Color32 color
Vessel color. The default is consistent with Serie. 容器颜色。默认和serie一致。
Definition: Vessel.cs:170
XCharts.Vessel.gap
float gap
The gap between the vessel and the liquid. 间隙。容器和液体的间隙。 [defaut: 10f]
Definition: Vessel.cs:96