From 5fe12dcde76403c59c24ff2889c69bd25de0e630 Mon Sep 17 00:00:00 2001 From: monitor1394 Date: Tue, 11 Apr 2023 23:05:10 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E5=8A=A8=E6=80=81=E6=B7=BB?= =?UTF-8?q?=E5=8A=A0=E7=BB=84=E4=BB=B6=E6=97=B6`Inspector`=E5=8F=AF?= =?UTF-8?q?=E8=83=BD=E5=BC=82=E5=B8=B8=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Runtime/Internal/BaseChart.Component.cs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/Runtime/Internal/BaseChart.Component.cs b/Runtime/Internal/BaseChart.Component.cs index dd57e897..1d009716 100644 --- a/Runtime/Internal/BaseChart.Component.cs +++ b/Runtime/Internal/BaseChart.Component.cs @@ -72,6 +72,7 @@ namespace XCharts.Runtime CreateComponentHandler(component); #if UNITY_EDITOR && UNITY_2019_1_OR_NEWER UnityEditor.EditorUtility.SetDirty(this); + OnBeforeSerialize(); #endif return component; } @@ -88,6 +89,7 @@ namespace XCharts.Runtime } component.index = list.Count; list.Add(component); + m_Components.Sort((a, b) => { return a.GetType().Name.CompareTo(b.GetType().Name); }); } private void CheckAddRequireChartComponent(Type type) @@ -179,6 +181,10 @@ namespace XCharts.Runtime { if (component.gameObject != null) ChartHelper.SetActive(component.gameObject, false); +#if UNITY_EDITOR && UNITY_2019_1_OR_NEWER + UnityEditor.EditorUtility.SetDirty(this); + OnBeforeSerialize(); +#endif InitComponentHandlers(); RefreshChart(); return true;