diff --git a/Assets/XCharts/Demo/Runtime/Demo.cs b/Assets/XCharts/Demo/Runtime/Demo.cs index 270650d9..57ffdc46 100644 --- a/Assets/XCharts/Demo/Runtime/Demo.cs +++ b/Assets/XCharts/Demo/Runtime/Demo.cs @@ -96,7 +96,7 @@ namespace XCharts var btnPanel = transform.Find("chart_list"); m_BtnClone = transform.Find("btn_clone").gameObject; m_BtnClone.SetActive(false); - ChartHelper.DestoryAllChilds(btnPanel); + //ChartHelper.DestroyAllChildren(btnPanel); foreach (var module in m_ChartModule) { var btnName = "btn_" + module.name; diff --git a/Assets/XCharts/Runtime/Internal/BaseChart.cs b/Assets/XCharts/Runtime/Internal/BaseChart.cs index 104811b4..1f5ab2c5 100644 --- a/Assets/XCharts/Runtime/Internal/BaseChart.cs +++ b/Assets/XCharts/Runtime/Internal/BaseChart.cs @@ -213,7 +213,7 @@ namespace XCharts totalLegend++; } m_Legend.RemoveButton(); - ChartHelper.DestoryAllChilds(legendObject.transform); + ChartHelper.DestroyAllChildren(legendObject.transform); if (!m_Legend.show) return; for (int i = 0; i < datas.Count; i++) { @@ -289,7 +289,7 @@ namespace XCharts { var labelObject = ChartHelper.AddObject(s_SerieLabelObjectName, transform, chartAnchorMin, chartAnchorMax, chartPivot, new Vector2(chartWidth, chartHeight)); - ChartHelper.DestoryAllChilds(labelObject.transform); + // ChartHelper.DestroyAllChildren(labelObject.transform); int count = 0; for (int i = 0; i < m_Series.Count; i++) { diff --git a/Assets/XCharts/Runtime/Utility/ChartHelper.cs b/Assets/XCharts/Runtime/Utility/ChartHelper.cs index b23f1595..f7a30862 100644 --- a/Assets/XCharts/Runtime/Utility/ChartHelper.cs +++ b/Assets/XCharts/Runtime/Utility/ChartHelper.cs @@ -72,12 +72,12 @@ namespace XCharts } } - public static void DestoryAllChilds(Transform parent) + public static void DestroyAllChildren(Transform parent) { while (parent.childCount > 0) { var go = parent.GetChild(0); - if (go.childCount > 0) DestoryAllChilds(go); + if (go.childCount > 0) DestroyAllChildren(go); else GameObject.DestroyImmediate(go.gameObject); } }