AirControl  1.3.0
Open Source, Modular, and Extensible Flight Simulator For Deep Learning Research
Arrow.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 {
15  [Serializable]
16  public class Arrow : SubComponent
17  {
18  [SerializeField] private float m_Width = 10;
19  [SerializeField] private float m_Height = 15;
20  [SerializeField] private float m_Offset = 0;
21  [SerializeField] private float m_Dent = 3;
22  [SerializeField] private Color32 m_Color = Color.clear;
23 
28  public float width
29  {
30  get { return m_Width; }
31  set { if (PropertyUtil.SetStruct(ref m_Width, value)) SetVerticesDirty(); }
32  }
37  public float height
38  {
39  get { return m_Height; }
40  set { if (PropertyUtil.SetStruct(ref m_Height, value)) SetVerticesDirty(); }
41  }
46  public float offset
47  {
48  get { return m_Offset; }
49  set { if (PropertyUtil.SetStruct(ref m_Offset, value)) SetVerticesDirty(); }
50  }
55  public float dent
56  {
57  get { return m_Dent; }
58  set { if (PropertyUtil.SetStruct(ref m_Dent, value)) SetVerticesDirty(); }
59  }
60 
65  public Color32 color
66  {
67  get { return m_Color; }
68  set { if (PropertyUtil.SetColor(ref m_Color, value)) SetVerticesDirty(); }
69  }
70 
71  public Arrow Clone()
72  {
73  var arrow = new Arrow();
74  arrow.width = width;
75  arrow.height = height;
76  arrow.offset = offset;
77  arrow.dent = dent;
78  arrow.color = color;
79  return arrow;
80  }
81 
82  public void Copy(Arrow arrow)
83  {
84  width = arrow.width;
85  height = arrow.height;
86  offset = arrow.offset;
87  dent = arrow.dent;
88  color = arrow.color;
89  }
90 
91  public Color32 GetColor(Color32 defaultColor)
92  {
93  if (ChartHelper.IsClearColor(color)) return defaultColor;
94  else return color;
95  }
96  }
97 }
XCharts.Arrow.dent
float dent
The dent of arrow. 箭头的凹度。
Definition: Arrow.cs:56
XCharts.Arrow.width
float width
The widht of arrow. 箭头宽。
Definition: Arrow.cs:29
XCharts.SubComponent
Definition: ChartComponent.cs:71
XCharts
Definition: RewardChart.cs:14
XCharts.Arrow
Definition: Arrow.cs:16
XCharts.Arrow.color
Color32 color
the color of arrow. 箭头颜色。
Definition: Arrow.cs:66
XCharts.Arrow.height
float height
The height of arrow. 箭头高。
Definition: Arrow.cs:38
XCharts.Arrow.offset
float offset
The offset of arrow. 箭头偏移。
Definition: Arrow.cs:47