AirControl  1.3.0
Open Source, Modular, and Extensible Flight Simulator For Deep Learning Research
GaugeAxisTheme.cs
1 /************************************************/
2 /* */
3 /* Copyright (c) 2018 - 2021 monitor1394 */
4 /* https://github.com/monitor1394 */
5 /* */
6 /************************************************/
7 
8 using System;
9 using System.Collections.Generic;
10 using UnityEngine;
11 
12 namespace XCharts
13 {
14  [Serializable]
16  {
17  [SerializeField] private Color32 m_BarBackgroundColor;
18  [SerializeField]
19  private List<StageColor> m_StageColor = new List<StageColor>()
20  {
21  new StageColor(0.2f,new Color32(145,199,174,255)),
22  new StageColor(0.8f,new Color32(99,134,158,255)),
23  new StageColor(1.0f,new Color32(194,53,49,255)),
24  };
28  public Color32 barBackgroundColor { get { return m_BarBackgroundColor; } set { m_BarBackgroundColor = value; } }
32  public List<StageColor> stageColor { get { return m_StageColor; } set { m_StageColor = value; } }
33 
34  public GaugeAxisTheme(Theme theme) : base(theme)
35  {
36  m_LineWidth = XChartsSettings.gaugeAxisLineWidth;
37  m_LineLength = 0;
38  m_SplitLineWidth = XChartsSettings.gaugeAxisSplitLineWidth;
39  m_SplitLineLength = XChartsSettings.gaugeAxisSplitLineLength;
40  m_TickWidth = XChartsSettings.gaugeAxisTickWidth;
41  m_TickLength = XChartsSettings.gaugeAxisTickLength;
42  m_SplitLineColor = Color.white;
43  m_TickColor = Color.white;
44  switch (theme)
45  {
46  case Theme.Default:
47  m_BarBackgroundColor = new Color32(200, 200, 200, 255);
48  m_StageColor = new List<StageColor>()
49  {
50  new StageColor(0.2f,new Color32(145,199,174,255)),
51  new StageColor(0.8f,new Color32(99,134,158,255)),
52  new StageColor(1.0f,new Color32(194,53,49,255)),
53  };
54  break;
55  case Theme.Light:
56  m_BarBackgroundColor = new Color32(200, 200, 200, 255);
57  m_StageColor = new List<StageColor>()
58  {
59  new StageColor(0.2f,new Color32(145,199,174,255)),
60  new StageColor(0.8f,new Color32(99,134,158,255)),
61  new StageColor(1.0f,new Color32(194,53,49,255)),
62  };
63  break;
64  case Theme.Dark:
65  m_BarBackgroundColor = new Color32(200, 200, 200, 255);
66  m_StageColor = new List<StageColor>()
67  {
68  new StageColor(0.2f,new Color32(145,199,174,255)),
69  new StageColor(0.8f,new Color32(99,134,158,255)),
70  new StageColor(1.0f,new Color32(194,53,49,255)),
71  };
72  break;
73  }
74  }
75 
76  public void Copy(GaugeAxisTheme theme)
77  {
78  base.Copy(theme);
79  m_BarBackgroundColor = theme.barBackgroundColor;
80  ChartHelper.CopyList(m_StageColor, theme.stageColor);
81  }
82  }
83 }
XCharts.GaugeAxisTheme.stageColor
List< StageColor > stageColor
阶段颜色。
Definition: GaugeAxisTheme.cs:32
XCharts.Theme
Theme
主题
Definition: ChartTheme.cs:21
XCharts.StageColor
Definition: GaugeAxisLine.cs:14
XCharts.GaugeAxisTheme
Definition: GaugeAxisTheme.cs:15
XCharts.GaugeAxisTheme.barBackgroundColor
Color32 barBackgroundColor
进度条背景颜色。
Definition: GaugeAxisTheme.cs:28
XCharts
Definition: RewardChart.cs:14
XCharts.BaseAxisTheme
Definition: AxisTheme.cs:18
XCharts.XChartsSettings
Definition: XChartsSettings.cs:25