Skip to content

Commit

Permalink
优化 getAllComponents 方法 | 添加组件缓存清除方法
Browse files Browse the repository at this point in the history
  • Loading branch information
esengine committed May 10, 2023
1 parent 896ee68 commit 6240ddd
Show file tree
Hide file tree
Showing 4 changed files with 98 additions and 94 deletions.
7 changes: 7 additions & 0 deletions source/bin/gs.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,9 @@ declare module gs {
}
}
declare module gs {
/**
* 实体类,用于管理实体的组件和标签。
*/
class Entity {
private id;
private componentManagers;
Expand Down Expand Up @@ -136,6 +139,10 @@ declare module gs {
* @returns
*/
hasComponent<T extends Component>(componentType: new (entityId: number) => T): boolean;
/**
* 清除组件缓存
*/
clearComponentCache(): void;
/**
* 添加标签
* @param tag
Expand Down
Loading

0 comments on commit 6240ddd

Please sign in to comment.