请问创建UI报空是为什么呢

初始函数public void Init()
{
UIPackage.AddPackage("UI/HpComponent/HpComponent");
HpComponentBinder.BindAll();
view = new GComponent();
GRoot.inst.AddChild(view);
}

生成代码
UI_HpComponent comp = UI_HpComponent.CreateInstance();
Debug.Log(comp);
comp.container.fairyBatching = true;
view.AddChild(comp);
hpHUD = comp;
 
报错信息
NullReferenceException: Object reference not set to an instance of an object
已邀请:

谷主

赞同来自:

那一行报错都不说,这是什么操作

要回复问题请先登录注册