mirror of
https://github.com/XCharts-Team/XCharts.git
synced 2026-05-24 09:50:15 +00:00
修复Chart在运行时动态添加Component异常的问题 (#339)
This commit is contained in:
@@ -52,6 +52,7 @@ namespace XCharts.Runtime
|
||||
|
||||
public MainComponent AddChartComponent(Type type)
|
||||
{
|
||||
InitListForFieldInfos();
|
||||
if (!CanAddChartComponent(type))
|
||||
{
|
||||
Debug.LogError("XCharts ERROR: CanAddChartComponent:" + type.Name);
|
||||
|
||||
@@ -724,7 +724,7 @@ namespace XCharts.Runtime
|
||||
|
||||
private void InitListForFieldInfos()
|
||||
{
|
||||
if (m_TypeListForSerie.Count != 0) return;
|
||||
if (m_TypeListForSerie.Count != 0 || m_TypeListForComponent.Count != 0) return;
|
||||
m_TypeListForComponent.Clear();
|
||||
m_TypeListForSerie.Clear();
|
||||
var fileds1 = GetType().GetFields(BindingFlags.NonPublic | BindingFlags.Instance);
|
||||
|
||||
Reference in New Issue
Block a user