版本:1.9.1-rc
逻辑:子弹组件中update里判断超过一定时间(如0.5秒)后,设置节点active为false。
同时,组件还做碰撞监听回调,在onBeginContact方法中设置节点active为false,没有其他逻辑。
结果运行中,当子弹碰撞到其他刚体时,经常会报错:
ERROR: TypeError: undefined is not an object (evaluating ‘a.body’), location: src/jsb_polyfill.js:11823:74
STACK:
emit@src/jsb_polyfill.js:11823:74
_onBeginContact@src/jsb_polyfill.js:12088:30
Step@[native code]
update@src/jsb_polyfill.js:11934:7
ERROR: TypeError: undefined is not an object (evaluating ‘a.body’), location: src/jsb_polyfill.js:11823:74
STACK:
emit@src/jsb_polyfill.js:11823:74
_onPreSolve@src/jsb_polyfill.js:12099:12
Step@[native code]
update@src/jsb_polyfill.js:11934:7
ERROR: TypeError: undefined is not an object (evaluating ‘a.body’), location: src/jsb_polyfill.js:11823:74
STACK:
emit@src/jsb_polyfill.js:11823:74
_onPostSolve@src/jsb_polyfill.js:12105:7
Step@[native code]
update@src/jsb_polyfill.js:11934:7
ERROR: TypeError: undefined is not an object (evaluating ‘a.body’), location: src/jsb_polyfill.js:11823:74
STACK:
emit@src/jsb_polyfill.js:11823:74
_onEndContact@src/jsb_polyfill.js:12093:7
DestroyBody@[native code]
_removeBody@src/jsb_polyfill.js:12046:14
__destroy@src/jsb_polyfill.js:12669:44
pushDelayEvent@src/jsb_polyfill.js:11916:16
_destroy@src/jsb_polyfill.js:12644:47
onDisable@src/jsb_polyfill.js:12617:14
disableComp@src/jsb_polyfill.js:3586:27
_deactivateNodeRecursively@src/jsb_polyfill.js:11642:39
activateNode@src/jsb_polyfill.js:11673:32
set@src/jsb_polyfill.js:16750:64
bulletBoom@src/project.js:1149:10
update@src/project.js:1159:16
anonymous
invoke@src/jsb_polyfill.js:3535:13
updatePhase@src/jsb_polyfill.js:3608:26
callback@src/jsb_polyfill.js:21736:39