diff --git a/CHANGELOG-EN.md b/CHANGELOG-EN.md index 5494e09e..625b0d66 100644 --- a/CHANGELOG-EN.md +++ b/CHANGELOG-EN.md @@ -39,6 +39,7 @@ ## master +* (2021.08.25) Fixed an issue where the theme switch could not be save to the scene (#166) * (2021.08.24) Added `Animation`'s `alongWithLinePath` * (2021.08.22) Added `Serie`'s `ignoreLineBreak` (#164) * (2021.08.22) Fixed `Axis` label may not be updated when `DataZoom` is turn on (#164) diff --git a/CHANGELOG.md b/CHANGELOG.md index efc04c20..3850f33e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -39,6 +39,7 @@ ## master +* (2021.08.25) 修复`Theme`主题切换无法保持到场景上的问题 (#166) * (2021.08.24) 增加`Animation`的`alongWithLinePath`参数设置折线轨迹匀速动画 * (2021.08.22) 增加`Serie`的`ignoreLineBreak`参数设置忽略数据连线是否断开 (#164) * (2021.08.22) 修复`Axis`在`DataZoom`开启时`Label`可能不更新的问题 (#164) diff --git a/Runtime/API/BaseChart_API.cs b/Runtime/API/BaseChart_API.cs index 507abc8d..b65d42a9 100644 --- a/Runtime/API/BaseChart_API.cs +++ b/Runtime/API/BaseChart_API.cs @@ -643,6 +643,9 @@ namespace XCharts { m_Theme.CopyTheme(theme); SetAllComponentDirty(); +#if UNITY_EDITOR + UnityEditor.EditorUtility.SetDirty(this); +#endif } /// diff --git a/Runtime/Internal/BaseChart.cs b/Runtime/Internal/BaseChart.cs index 62ce23d0..b3665378 100644 --- a/Runtime/Internal/BaseChart.cs +++ b/Runtime/Internal/BaseChart.cs @@ -224,6 +224,9 @@ namespace XCharts { m_CheckTheme = m_Theme.theme; m_Theme.CopyTheme(m_CheckTheme); +#if UNITY_EDITOR + UnityEditor.EditorUtility.SetDirty(this); +#endif SetAllComponentDirty(); OnThemeChanged(); }