修复Chart在运行时被删除时会异常报错的问题 (#269)

This commit is contained in:
monitor1394
2023-08-12 22:18:25 +08:00
parent d0d5c2a101
commit 71c8bc1499
5 changed files with 17 additions and 3 deletions

View File

@@ -127,16 +127,21 @@ namespace XCharts.Runtime
}
#if UNITY_EDITOR
protected override void Reset() { }
protected override void Reset()
{
base.Reset();
}
protected override void OnValidate()
{
base.OnValidate();
m_IsOnValidate = true;
}
#endif
protected override void OnDestroy()
{
base.OnDestroy();
for (int i = transform.childCount - 1; i >= 0; i--)
{
DestroyImmediate(transform.GetChild(i).gameObject);