修复transform.setparent报错

This commit is contained in:
yhh
2021-03-30 18:02:27 +08:00
parent 0b8d752773
commit 7e94f42b10
6 changed files with 97 additions and 25 deletions

View File

@@ -194,7 +194,6 @@ module es {
let list = this.getTagList(tag);
let returnList = ListPool.obtain<Entity>();
returnList.length = this._entities.length;
for (let entity of list) {
returnList.push(entity);
}
@@ -202,6 +201,21 @@ module es {
return returnList;
}
/**
* 返回第一个找到该tag的实体
* @param tag
* @returns
*/
public entityWithTag(tag: number) {
let list = this.getTagList(tag);
for (let entity of list) {
return entity;
}
return null;
}
/**
* 返回一个T类型的所有实体的列表。
* 返回的List可以通过ListPool.free放回池中。