[LayaAir 2.0]bug:laya.Scene.destroy
var list=laya.display.Scene.unDestroyedScenes;
for (var i=0,n=list.length;i < n;i++){//这里缓存了长度,但是在
__proto.destroy=function(destroyChild){
(destroyChild===void 0)&& (destroyChild=true);
this._idMap=null;
_super.prototype.destroy.call(this,destroyChild);
var list=laya.display.Scene.unDestroyedScenes;
for (var i=0,n=list.length;i < n;i++){
if (list[i]===this){
list.splice(i,1);
return;
}
}
}这里改动了同一个数组,导致上面的循环越界
for (var i=0,n=list.length;i < n;i++){//这里缓存了长度,但是在
__proto.destroy=function(destroyChild){
(destroyChild===void 0)&& (destroyChild=true);
this._idMap=null;
_super.prototype.destroy.call(this,destroyChild);
var list=laya.display.Scene.unDestroyedScenes;
for (var i=0,n=list.length;i < n;i++){
if (list[i]===this){
list.splice(i,1);
return;
}
}
}这里改动了同一个数组,导致上面的循环越界
没有找到相关结果
已邀请:
要回复问题请先登录
2 个回复
Aar0n
赞同来自:
dasonjack
赞同来自:
Laya.Scene.open('test/TestView2.scene',false)
Laya.Scene.open('test/TestView3.scene',false)
当有多个场景时候,destroy中间的场景就有问题
Laya.Scene.destroy('test/TestView2.scene')
=================================laya.display.Scene.unDestroyedScenes这个数组