AirControl  1.3.0
Open Source, Modular, and Extensible Flight Simulator For Deep Learning Research
SettingsDrawer.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(Settings), true)]
15  {
16  public override string ClassName { get { return "Settings"; } }
17  public override void OnGUI(Rect pos, SerializedProperty prop, GUIContent label)
18  {
19  base.OnGUI(pos, prop, label);
20  if (MakeFoldout(prop, ""))
21  {
22  var btnWidth = 50;
23  var btnRect = new Rect(pos.x + pos.width - btnWidth, pos.y, btnWidth, EditorGUIUtility.singleLineHeight);
24  if (GUI.Button(btnRect, new GUIContent("Reset", "Reset to default settings")))
25  {
26  var chart = prop.serializedObject.targetObject as BaseChart;
27  chart.settings.Reset();
28  }
29  ++EditorGUI.indentLevel;
30  PropertyField(prop, "m_ReversePainter");
31  PropertyField(prop, "m_MaxPainter");
32  PropertyField(prop, "m_BasePainterMaterial");
33  PropertyField(prop, "m_SeriePainterMaterial");
34  PropertyField(prop, "m_TopPainterMaterial");
35  PropertyField(prop, "m_LineSmoothStyle");
36  PropertyField(prop, "m_LineSmoothness");
37  PropertyField(prop, "m_LineSegmentDistance");
38  PropertyField(prop, "m_CicleSmoothness");
39  PropertyField(prop, "m_LegendIconLineWidth");
40  PropertyListField(prop, "m_LegendIconCornerRadius", true);
41  --EditorGUI.indentLevel;
42  }
43  }
44  }
45 }
XCharts.BasePropertyDrawer
Definition: BasePropertyDrawer.cs:15
XCharts.BaseChart.settings
Settings settings
Global parameter setting component. 全局设置组件。
Definition: BaseChart_API.cs:71
XCharts
Definition: RewardChart.cs:14
XCharts.SettingsDrawer
Definition: SettingsDrawer.cs:14
XCharts.SerieSymbolType.Rect
@ Rect
正方形。可通过设置itemStyle的cornerRadius变成圆角矩形。
XCharts.BaseChart
The base class of all charts. 所有Chart的基类。
Definition: BaseChart_API.cs:21