AirControl  1.3.0
Open Source, Modular, and Extensible Flight Simulator For Deep Learning Research
BaseLine.cs
1 /************************************************/
2 /* */
3 /* Copyright (c) 2018 - 2021 monitor1394 */
4 /* https://github.com/monitor1394 */
5 /* */
6 /************************************************/
7 
8 using UnityEngine;
9 
10 namespace XCharts
11 {
16  [System.Serializable]
17  public class BaseLine : SubComponent
18  {
19  [SerializeField] protected bool m_Show;
20  [SerializeField] protected LineStyle m_LineStyle = new LineStyle();
21 
26  public bool show
27  {
28  get { return m_Show; }
29  set { if (PropertyUtil.SetStruct(ref m_Show, value)) SetVerticesDirty(); }
30  }
34  public LineStyle lineStyle
35  {
36  get { return m_LineStyle; }
37  set { if (value != null) { m_LineStyle = value; SetVerticesDirty(); } }
38  }
39 
40  public static BaseLine defaultBaseLine
41  {
42  get
43  {
44  var axisLine = new BaseLine
45  {
46  m_Show = true,
47  m_LineStyle = new LineStyle()
48  };
49  return axisLine;
50  }
51  }
52 
53  public BaseLine()
54  {
55  lineStyle = new LineStyle();
56  }
57 
58  public BaseLine(bool show) : base()
59  {
60  m_Show = show;
61  }
62 
63  public void Copy(BaseLine axisLine)
64  {
65  show = axisLine.show;
66  lineStyle.Copy(axisLine.lineStyle);
67  }
68 
69  public LineStyle.Type GetType(LineStyle.Type themeType)
70  {
71  return lineStyle.GetType(themeType);
72  }
73 
74  public float GetWidth(float themeWidth)
75  {
76  return lineStyle.GetWidth(themeWidth);
77  }
78 
79  public float GetLength(float themeLength)
80  {
81  return lineStyle.GetLength(themeLength);
82  }
83 
84  public Color32 GetColor(Color32 themeColor)
85  {
86  return lineStyle.GetColor(themeColor);
87  }
88  }
89 }
XCharts.SubComponent
Definition: ChartComponent.cs:71
XCharts
Definition: RewardChart.cs:14
XCharts.LineStyle
The style of line. 线条样式。 注: 修改 lineStyle 中的颜色不会影响图例颜色,如果需要图例颜色和折线图颜色一致,需修改 itemStyle....
Definition: LineStyle.cs:20
XCharts.BaseLine.lineStyle
LineStyle lineStyle
线条样式
Definition: BaseLine.cs:35
XCharts.BaseLine
Settings related to base line. 线条基础配置。
Definition: BaseLine.cs:17
XCharts.BaseLine.show
bool show
Set this to false to prevent the axis line from showing. 是否显示坐标轴轴线。
Definition: BaseLine.cs:27