mirror of
https://gitee.com/dgflash/oops-plugin-framework.git
synced 2026-05-08 03:16:49 +08:00
修复实体销毁的时候,也会销毁子实体,但是销毁子实体的时候并没有removeChild。导致了这个实体再次被使用时,_children还留存着之前子实体的引用,但是这个子实体已经被销毁,而导致的报错
This commit is contained in:
@@ -267,6 +267,7 @@ export class ECSEntity {
|
||||
destroy() {
|
||||
if (this._children) {
|
||||
this._children.forEach(e => {
|
||||
this.removeChild(e);
|
||||
e.destroy();
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user