listpool根据type划分池
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
module es {
|
||||
export abstract class Collider extends Component {
|
||||
export class Collider extends Component {
|
||||
public static readonly lateSortOrder = 999;
|
||||
public castSortOrder: number = 0;
|
||||
/**
|
||||
|
||||
@@ -73,7 +73,7 @@ module es {
|
||||
}
|
||||
}
|
||||
|
||||
ListPool.free(colliders);
|
||||
ListPool.free(Collider, colliders);
|
||||
|
||||
return collisionResult.collider != null;
|
||||
}
|
||||
|
||||
@@ -223,7 +223,7 @@ module es {
|
||||
public entitiesWithTag(tag: number) {
|
||||
let list = this.getTagList(tag);
|
||||
|
||||
let returnList = ListPool.obtain<Entity>();
|
||||
let returnList = ListPool.obtain<Entity>(Entity);
|
||||
if (list.size > 0) {
|
||||
for (let entity of list) {
|
||||
returnList.push(entity);
|
||||
@@ -286,7 +286,7 @@ module es {
|
||||
* @param type
|
||||
*/
|
||||
public findComponentsOfType<T extends Component>(type): T[] {
|
||||
let comps = ListPool.obtain<T>();
|
||||
let comps = ListPool.obtain<T>(type);
|
||||
if (this._entities.length > 0) {
|
||||
for (let i = 0, s = this._entities.length; i < s; i++) {
|
||||
let entity = this._entities[i];
|
||||
|
||||
Reference in New Issue
Block a user