[]场景调用offAll会报错。

代码:
scene = new Scene();
Laya.stage.addChild(scene);
scene.offAll();
Laya.stage.removeChild(scene);
 scene = new Scene();
Laya.stage.addChild(scene);
scene.offAll();
Laya.stage.removeChild(scene);

scene = new Scene();
Laya.stage.addChild(scene);
Laya.stage.removeChild(scene);
 
报错:

QQ图片20180913120838.png

Uncaught TypeError: Cannot read property 'parent' of null
    at Function.Scene._sortScenes (file:///E:/laya3dProject/BY3D/bin/h5/BY3D.max.js:68570:8)
已邀请:

c416288806

赞同来自:

你们要的demo就是上面那段代码啦。新建项目的3D项目直接考进去跑就行

要回复问题请先

商务合作
商务合作