cc.game.run 包括加载 renderpipeline (#5798)

This commit is contained in:
黄森斌
2019-11-29 13:52:38 +08:00
committed by pandamicro
parent fd10ade041
commit 3a246bd4da
+18 -5
View File
@@ -492,13 +492,26 @@ export class Game extends EventTarget {
this._initConfig(config);
this._initRenderer();
this.onStart = onStart;
// load renderpipeline
cc.loader.load({ uuid: config.renderpipeline }, (err, asset) => {
// failed load renderPipeline
if (err || !(asset instanceof cc.RenderPipeline)) {
console.error(`Failed load renderpipeline: ${config.renderpipeline}`);
console.error(err);
if (!CC_EDITOR && CC_WECHATGAME/* && !CC_PREVIEW*/) {
SplashScreen.instance.main(this._gfxDevice as any);
}
cc.game.setRenderPipeline(null);
} else {
cc.game.setRenderPipeline(asset);
}
this.prepare(cc.game.onStart && cc.game.onStart.bind(cc.game));
this.onStart = onStart;
if (!CC_EDITOR && CC_WECHATGAME/* && !CC_PREVIEW*/) {
SplashScreen.instance.main(this._gfxDevice as any);
}
this.prepare(cc.game.onStart && cc.game.onStart.bind(cc.game));
});
}
// @ Persist root node section