mirror of
https://gitee.com/dgflash/oops-plugin-framework.git
synced 2026-06-07 18:52:23 +08:00
Merge branch 'master' of https://gitee.com/dgflash/oops-plugin-framework
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;
|
||||
|
||||
@@ -370,7 +370,7 @@ export class GameComponent extends Component {
|
||||
for (const name of args) {
|
||||
var func = self[name];
|
||||
if (func)
|
||||
this.on(name, self[name], this);
|
||||
this.on(name, func, this);
|
||||
else
|
||||
console.error(`名为【${name}】的全局事方法不存在`);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user