随机类移动至es命名空间

This commit is contained in:
yhh
2021-03-29 17:45:36 +08:00
parent e6096b644f
commit 0b8d752773
6 changed files with 1013 additions and 997 deletions

View File

@@ -212,7 +212,7 @@ module es {
* 返回第一个启用加载的类型为T的组件
* @param type
*/
public findComponentOfType<T extends Component>(type): T {
public findComponentOfType<T extends Component>(type: new (...args) => T): T {
return this.entities.findComponentOfType<T>(type);
}
@@ -220,7 +220,7 @@ module es {
* 返回类型为T的所有已启用已加载组件的列表
* @param type
*/
public findComponentsOfType<T extends Component>(type): T[] {
public findComponentsOfType<T extends Component>(type: new (...args) => T): T[] {
return this.entities.findComponentsOfType<T>(type);
}