mirror of
https://github.com/XCharts-Team/XCharts.git
synced 2026-05-30 21:38:49 +00:00
修复Chart在运行时动态添加Component异常的问题 (#339)
This commit is contained in:
@@ -79,6 +79,7 @@ slug: /changelog
|
|||||||
|
|
||||||
## master
|
## master
|
||||||
|
|
||||||
|
* (2025.01.15) 修复`Chart`在运行时动态添加`Component`异常的问题 (#339)
|
||||||
* (2025.01.08) 修复`TextMeshPro`关闭时残留组件影响`Text`初始化的问题
|
* (2025.01.08) 修复`TextMeshPro`关闭时残留组件影响`Text`初始化的问题
|
||||||
|
|
||||||
## v3.13.0
|
## v3.13.0
|
||||||
|
|||||||
@@ -52,6 +52,7 @@ namespace XCharts.Runtime
|
|||||||
|
|
||||||
public MainComponent AddChartComponent(Type type)
|
public MainComponent AddChartComponent(Type type)
|
||||||
{
|
{
|
||||||
|
InitListForFieldInfos();
|
||||||
if (!CanAddChartComponent(type))
|
if (!CanAddChartComponent(type))
|
||||||
{
|
{
|
||||||
Debug.LogError("XCharts ERROR: CanAddChartComponent:" + type.Name);
|
Debug.LogError("XCharts ERROR: CanAddChartComponent:" + type.Name);
|
||||||
|
|||||||
@@ -724,7 +724,7 @@ namespace XCharts.Runtime
|
|||||||
|
|
||||||
private void InitListForFieldInfos()
|
private void InitListForFieldInfos()
|
||||||
{
|
{
|
||||||
if (m_TypeListForSerie.Count != 0) return;
|
if (m_TypeListForSerie.Count != 0 || m_TypeListForComponent.Count != 0) return;
|
||||||
m_TypeListForComponent.Clear();
|
m_TypeListForComponent.Clear();
|
||||||
m_TypeListForSerie.Clear();
|
m_TypeListForSerie.Clear();
|
||||||
var fileds1 = GetType().GetFields(BindingFlags.NonPublic | BindingFlags.Instance);
|
var fileds1 = GetType().GetFields(BindingFlags.NonPublic | BindingFlags.Instance);
|
||||||
|
|||||||
Reference in New Issue
Block a user