From 86e66984d4b21f92388be3900e63b22139cf0379 Mon Sep 17 00:00:00 2001 From: monitor1394 Date: Sun, 4 Jun 2023 21:52:23 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0`HelpDoc`=E5=B8=AE=E5=8A=A9?= =?UTF-8?q?=E6=96=87=E6=A1=A3=E8=B7=B3=E8=BD=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Editor/MainComponents/MainComponentListEditor.cs | 5 +++-- Editor/Utilities/ChartEditorHelper.cs | 16 +++++++++------- Runtime/Chart/BarChart.cs | 1 + Runtime/Chart/CandlestickChart.cs | 1 + Runtime/Chart/HeatmapChart.cs | 1 + Runtime/Chart/LineChart.cs | 1 + Runtime/Chart/ParallelChart.cs | 1 + Runtime/Chart/PieChart.cs | 1 + Runtime/Chart/PolarChart.cs | 1 + Runtime/Chart/RadarChart.cs | 1 + Runtime/Chart/RingChart.cs | 1 + Runtime/Chart/ScatterChart.cs | 1 + Runtime/Chart/SimplifiedBarChart.cs | 1 + Runtime/Chart/SimplifiedCandlestickChart.cs | 1 + Runtime/Chart/SimplifiedLineChart.cs | 1 + 15 files changed, 25 insertions(+), 9 deletions(-) diff --git a/Editor/MainComponents/MainComponentListEditor.cs b/Editor/MainComponents/MainComponentListEditor.cs index 87ec7a62..751904d7 100644 --- a/Editor/MainComponents/MainComponentListEditor.cs +++ b/Editor/MainComponents/MainComponentListEditor.cs @@ -82,8 +82,9 @@ namespace XCharts.Editor title, editor.baseProperty, editor.showProperty, - () => { ResetComponentEditor(id); }, - () => { RemoveComponentEditor(id); } + () => { if (EditorUtility.DisplayDialog("", "Sure reset " + editor.component.GetType().Name + "?", "Yes", "Cancel")) ResetComponentEditor(id); }, + () => { if (EditorUtility.DisplayDialog("", "Sure remove " + editor.component.GetType().Name + "?", "Yes", "Cancel")) RemoveComponentEditor(id); }, + () => { Application.OpenURL("https://xcharts-team.github.io/docs/configuration/#" + editor.component.GetType().Name.ToLower()); } ); if (displayContent) { diff --git a/Editor/Utilities/ChartEditorHelper.cs b/Editor/Utilities/ChartEditorHelper.cs index 0c0aeb64..3d59a66b 100644 --- a/Editor/Utilities/ChartEditorHelper.cs +++ b/Editor/Utilities/ChartEditorHelper.cs @@ -52,7 +52,7 @@ namespace XCharts.Editor public static void SecondField(Rect drawRect, SerializedProperty prop) { - RectOffset offset = new RectOffset(-(int) EditorGUIUtility.labelWidth, 0, 0, 0); + RectOffset offset = new RectOffset(-(int)EditorGUIUtility.labelWidth, 0, 0, 0); drawRect = offset.Add(drawRect); EditorGUI.PropertyField(drawRect, prop, GUIContent.none); drawRect = offset.Remove(drawRect); @@ -180,8 +180,8 @@ namespace XCharts.Editor if (prop.propertyType == SerializedPropertyType.Boolean) { if (!propEnable) - using(new EditorGUI.DisabledScope(true)) - MakeBool(drawRect, prop); + using (new EditorGUI.DisabledScope(true)) + MakeBool(drawRect, prop); else MakeBool(drawRect, prop); if (prop2 != null && !moduleToggle[key]) @@ -444,7 +444,7 @@ namespace XCharts.Editor if (prop.propertyType == SerializedPropertyType.Float && prop.floatValue < minValue) prop.floatValue = minValue; if (prop.propertyType == SerializedPropertyType.Integer && prop.intValue < minValue) - prop.intValue = (int) minValue; + prop.intValue = (int)minValue; var hig = EditorGUI.GetPropertyHeight(prop); drawRect.y += hig; heights[key] += hig; @@ -459,7 +459,7 @@ namespace XCharts.Editor if (prop.propertyType == SerializedPropertyType.Float && prop.floatValue > maxValue) prop.floatValue = maxValue; if (prop.propertyType == SerializedPropertyType.Integer && prop.intValue > maxValue) - prop.intValue = (int) maxValue; + prop.intValue = (int)maxValue; var hig = EditorGUI.GetPropertyHeight(prop); drawRect.y += hig; heights[key] += hig; @@ -635,11 +635,13 @@ namespace XCharts.Editor } internal static bool DrawHeader(string title, SerializedProperty group, SerializedProperty activeField, - Action resetAction, Action removeAction) + Action resetAction, Action removeAction, Action docAction) { if (group == null) return false; group.isExpanded = DrawHeader(title, group.isExpanded, false, activeField, null, - new HeaderMenuInfo("Reset", resetAction), new HeaderMenuInfo("Remove", removeAction)); + new HeaderMenuInfo("Reset", resetAction), + new HeaderMenuInfo("Remove", removeAction), + new HeaderMenuInfo("HelpDoc", docAction)); return group.isExpanded; } diff --git a/Runtime/Chart/BarChart.cs b/Runtime/Chart/BarChart.cs index a8284f86..77a6aa67 100644 --- a/Runtime/Chart/BarChart.cs +++ b/Runtime/Chart/BarChart.cs @@ -6,6 +6,7 @@ namespace XCharts.Runtime [ExecuteInEditMode] [RequireComponent(typeof(RectTransform))] [DisallowMultipleComponent] + [HelpURL("https://xcharts-team.github.io/docs/configuration")] public class BarChart : BaseChart { protected override void DefaultChart() diff --git a/Runtime/Chart/CandlestickChart.cs b/Runtime/Chart/CandlestickChart.cs index 62bf4666..34672fc8 100644 --- a/Runtime/Chart/CandlestickChart.cs +++ b/Runtime/Chart/CandlestickChart.cs @@ -6,6 +6,7 @@ namespace XCharts.Runtime [ExecuteInEditMode] [RequireComponent(typeof(RectTransform))] [DisallowMultipleComponent] + [HelpURL("https://xcharts-team.github.io/docs/configuration")] public class CandlestickChart : BaseChart { protected override void DefaultChart() diff --git a/Runtime/Chart/HeatmapChart.cs b/Runtime/Chart/HeatmapChart.cs index 3bdcda09..d7e4533e 100644 --- a/Runtime/Chart/HeatmapChart.cs +++ b/Runtime/Chart/HeatmapChart.cs @@ -7,6 +7,7 @@ namespace XCharts.Runtime [ExecuteInEditMode] [RequireComponent(typeof(RectTransform))] [DisallowMultipleComponent] + [HelpURL("https://xcharts-team.github.io/docs/configuration")] public class HeatmapChart : BaseChart { protected override void DefaultChart() diff --git a/Runtime/Chart/LineChart.cs b/Runtime/Chart/LineChart.cs index bc1dc084..d1185871 100644 --- a/Runtime/Chart/LineChart.cs +++ b/Runtime/Chart/LineChart.cs @@ -6,6 +6,7 @@ namespace XCharts.Runtime [ExecuteInEditMode] [RequireComponent(typeof(RectTransform))] [DisallowMultipleComponent] + [HelpURL("https://xcharts-team.github.io/docs/configuration")] public class LineChart : BaseChart { protected override void DefaultChart() diff --git a/Runtime/Chart/ParallelChart.cs b/Runtime/Chart/ParallelChart.cs index 63abdf69..7552546b 100644 --- a/Runtime/Chart/ParallelChart.cs +++ b/Runtime/Chart/ParallelChart.cs @@ -7,6 +7,7 @@ namespace XCharts.Runtime [ExecuteInEditMode] [RequireComponent(typeof(RectTransform))] [DisallowMultipleComponent] + [HelpURL("https://xcharts-team.github.io/docs/configuration")] public class ParallelChart : BaseChart { protected override void DefaultChart() diff --git a/Runtime/Chart/PieChart.cs b/Runtime/Chart/PieChart.cs index 0cee6a3a..02779cd6 100644 --- a/Runtime/Chart/PieChart.cs +++ b/Runtime/Chart/PieChart.cs @@ -6,6 +6,7 @@ namespace XCharts.Runtime [ExecuteInEditMode] [RequireComponent(typeof(RectTransform))] [DisallowMultipleComponent] + [HelpURL("https://xcharts-team.github.io/docs/configuration")] public class PieChart : BaseChart { protected override void DefaultChart() diff --git a/Runtime/Chart/PolarChart.cs b/Runtime/Chart/PolarChart.cs index 580efb92..95b268b2 100644 --- a/Runtime/Chart/PolarChart.cs +++ b/Runtime/Chart/PolarChart.cs @@ -6,6 +6,7 @@ namespace XCharts.Runtime [ExecuteInEditMode] [RequireComponent(typeof(RectTransform))] [DisallowMultipleComponent] + [HelpURL("https://xcharts-team.github.io/docs/configuration")] public class PolarChart : BaseChart { protected override void DefaultChart() diff --git a/Runtime/Chart/RadarChart.cs b/Runtime/Chart/RadarChart.cs index ca01353b..e256b182 100644 --- a/Runtime/Chart/RadarChart.cs +++ b/Runtime/Chart/RadarChart.cs @@ -6,6 +6,7 @@ namespace XCharts.Runtime [ExecuteInEditMode] [RequireComponent(typeof(RectTransform))] [DisallowMultipleComponent] + [HelpURL("https://xcharts-team.github.io/docs/configuration")] public class RadarChart : BaseChart { protected override void DefaultChart() diff --git a/Runtime/Chart/RingChart.cs b/Runtime/Chart/RingChart.cs index ae04dd2a..33c351e6 100644 --- a/Runtime/Chart/RingChart.cs +++ b/Runtime/Chart/RingChart.cs @@ -6,6 +6,7 @@ namespace XCharts.Runtime [ExecuteInEditMode] [RequireComponent(typeof(RectTransform))] [DisallowMultipleComponent] + [HelpURL("https://xcharts-team.github.io/docs/configuration")] public class RingChart : BaseChart { protected override void DefaultChart() diff --git a/Runtime/Chart/ScatterChart.cs b/Runtime/Chart/ScatterChart.cs index 9f44c902..de04423e 100644 --- a/Runtime/Chart/ScatterChart.cs +++ b/Runtime/Chart/ScatterChart.cs @@ -6,6 +6,7 @@ namespace XCharts.Runtime [ExecuteInEditMode] [RequireComponent(typeof(RectTransform))] [DisallowMultipleComponent] + [HelpURL("https://xcharts-team.github.io/docs/configuration")] public class ScatterChart : BaseChart { protected override void DefaultChart() diff --git a/Runtime/Chart/SimplifiedBarChart.cs b/Runtime/Chart/SimplifiedBarChart.cs index f2079b3a..0fef9ccd 100644 --- a/Runtime/Chart/SimplifiedBarChart.cs +++ b/Runtime/Chart/SimplifiedBarChart.cs @@ -6,6 +6,7 @@ namespace XCharts.Runtime [ExecuteInEditMode] [RequireComponent(typeof(RectTransform))] [DisallowMultipleComponent] + [HelpURL("https://xcharts-team.github.io/docs/configuration")] public class SimplifiedBarChart : BaseChart { protected override void DefaultChart() diff --git a/Runtime/Chart/SimplifiedCandlestickChart.cs b/Runtime/Chart/SimplifiedCandlestickChart.cs index 0d2d8ef5..e8d90aa1 100644 --- a/Runtime/Chart/SimplifiedCandlestickChart.cs +++ b/Runtime/Chart/SimplifiedCandlestickChart.cs @@ -6,6 +6,7 @@ namespace XCharts.Runtime [ExecuteInEditMode] [RequireComponent(typeof(RectTransform))] [DisallowMultipleComponent] + [HelpURL("https://xcharts-team.github.io/docs/configuration")] public class SimplifiedCandlestickChart : BaseChart { protected override void DefaultChart() diff --git a/Runtime/Chart/SimplifiedLineChart.cs b/Runtime/Chart/SimplifiedLineChart.cs index 4553cbbe..bf023dc6 100644 --- a/Runtime/Chart/SimplifiedLineChart.cs +++ b/Runtime/Chart/SimplifiedLineChart.cs @@ -6,6 +6,7 @@ namespace XCharts.Runtime [ExecuteInEditMode] [RequireComponent(typeof(RectTransform))] [DisallowMultipleComponent] + [HelpURL("https://xcharts-team.github.io/docs/configuration")] public class SimplifiedLineChart : BaseChart { protected override void DefaultChart()