优化实体列表add/remove效率。性能大幅度提高

This commit is contained in:
yhh
2021-04-16 17:48:13 +08:00
parent 5a6d1c72fe
commit 17b36f01b0
14 changed files with 1494 additions and 211 deletions

View File

@@ -1,16 +1,5 @@
///<reference path="../Math/Vector2.ts" />
module es {
export enum SceneResolutionPolicy {
/**
* 默认情况下RenderTarget与屏幕大小匹配。RenderTarget与屏幕大小相匹配
*/
none,
/**
* 该应用程序采用最适合设计分辨率的宽度和高度
*/
bestFit
}
/** 场景 */
export class Scene {
/**
@@ -208,14 +197,6 @@ module es {
public findEntityWithTag(tag: number): Entity {
return this.entities.entityWithTag(tag);
}
/**
* 返回类型为T的所有实体
* @param type
*/
public entitiesOfType<T extends Entity>(type): T[] {
return this.entities.entitiesOfType<T>(type);
}
/**
* 返回第一个启用加载的类型为T的组件