加载组件时后报错 Cannot read property 'maskParent' of undefined

Laya.loader.load([
{ url: "res/TestPackage_atlas0.png", type: laya.net.Loader.IMAGE },
{ url: "res/TestPackage.fui", type: laya.net.Loader.BUFFER }],
laya.utils.Handler.create(this, this.loadFairyGUIRes));
private loadFairyGUIRes() {
fairygui.UIPackage.addPackage("res/TestPackage");
Laya.stage.addChild(fairygui.GRoot.inst.displayObject);
let btn = fairygui.UIPackage.createObject("TestPackage", "Test_Contnetion").asCom;
fairygui.GRoot.inst.addChild(btn);
}

已邀请:

gbgabyte - 游戏开发

赞同来自:

报了以下的

TypeError: Cannot read property 'maskParent' of undefined
at e.<anonymous> (file:///C:/Users/ASUS/Desktop/Nick_Test1/bin/libs/fairygui/fairygui.min.js:1:28465)
at e.s.buildNativeDisplayList (file:///C:/Users/ASUS/Desktop/Nick_Test1/bin/libs/fairygui/fairygui.min.js:6:491)
at e.s.constructFromResource2 (file:///C:/Users/ASUS/Desktop/Nick_Test1/bin/libs/fairygui/fairygui.min.js:6:9027)
at e.s.constructFromResource (file:///C:/Users/ASUS/Desktop/Nick_Test1/bin/libs/fairygui/fairygui.min.js:6:6428)
at t.s.internalCreateObject (file:///C:/Users/ASUS/Desktop/Nick_Test1/bin/libs/fairygui/fairygui.min.js:5:3480)
at t.s.createObject (file:///C:/Users/ASUS/Desktop/Nick_Test1/bin/libs/fairygui/fairygui.min.js:5:3275)
at Function.t.createObject (file:///C:/Users/ASUS/Desktop/Nick_Test1/bin/libs/fairygui/fairygui.min.js:5:7125)
at GameMain.loadFairyGUIRes (file:///C:/Users/ASUS/Desktop/Nick_Test1/bin/js/LayaSample.js:44:38)
at Handler.__proto.runWith (file:///C:/Users/ASUS/Desktop/Nick_Test1/bin/libs/laya.core.js:724:59)
at ResInfo.loadComplete (file:///C:/Users/ASUS/Desktop/Nick_Test1/bin/libs/laya.core.js:13518:14)
 

要回复问题请先登录注册