mirror of
https://gitee.com/dgflash/oops-plugin-framework.git
synced 2026-05-08 03:16:49 +08:00
ECSEntity.removeChild添加isDestroy是否释放实体参数
This commit is contained in:
@@ -96,13 +96,15 @@ export class ECSEntity {
|
||||
|
||||
/**
|
||||
* 移除子实体
|
||||
* @param entity 被移除的实体对象
|
||||
* @param entity 被移除的实体对象
|
||||
* @param isDestroy 被移除的实体是否释放,默认为释放
|
||||
* @returns
|
||||
*/
|
||||
removeChild(entity: ECSEntity) {
|
||||
removeChild(entity: ECSEntity, isDestroy = true) {
|
||||
if (this.children == null) return;
|
||||
|
||||
this.children.delete(entity.eid);
|
||||
if (isDestroy) entity.destroy();
|
||||
|
||||
if (this.children.size == 0) {
|
||||
this._children = null;
|
||||
|
||||
Reference in New Issue
Block a user