hiloteam / Hilo

A Cross-end HTML5 Game development solution
https://hiloteam.github.io/
MIT License
5.93k stars 863 forks source link

从物理世界中删除静态容器时引发持续的assert #128

Closed 467598557 closed 6 years ago

467598557 commented 6 years ago

for(var i = this._deleteBodies.length - 1;i >= 0;i --){ var body = this._deleteBodies[i]; var shapeList = body.shapeList; for(var j = shapeList.length - 1;j >= 0;j --){ space.removeShape(shapeList[j]); } if(!body.isStatic()) { space.removeBody(body); } } this._deleteBodies.length = 0;

if(!body.isStatic()) { space.removeBody(body); } 在从物理世界中解绑一个view,会尝试从space中删除body,然而,静态view并不会添加到space中的bodies数组中,进而引发assert抛出异常,不影响流程,但是持续报错,第二段代码中的判断是我自己添加的,运行之后就不会持续assert了,不知是否符合正确的逻辑

06wj commented 6 years ago

感谢,已修复