This commit is contained in:
monitor1394
2022-03-20 18:52:50 +08:00
parent 4e24ba7922
commit c510831f59
64 changed files with 562 additions and 159 deletions

View File

@@ -55,12 +55,16 @@ namespace XCharts.Runtime
{
if (!CanAddChartComponent(type))
{
throw new InvalidOperationException("CanAddChartComponent:" + type.Name);
Debug.LogError("XCharts ERROR: CanAddChartComponent:" + type.Name);
return null;
}
CheckAddRequireChartComponent(type);
var component = Activator.CreateInstance(type) as MainComponent;
if (component == null)
throw new InvalidOperationException("CanAddChartComponent:" + type.Name);
{
Debug.LogError("XCharts ERROR: CanAddChartComponent:" + type.Name);
return null;
}
component.SetDefaultValue();
if (component is IUpdateRuntimeData)
(component as IUpdateRuntimeData).UpdateRuntimeData(chartX, chartY, chartWidth, chartHeight);