1.新增类型识别

2.EntitySystem新增initialize生命周期,构造函数后执行
This commit is contained in:
yhh
2021-03-31 16:59:21 +08:00
parent 7e94f42b10
commit 781bad9573
6 changed files with 11 additions and 9 deletions

View File

@@ -124,7 +124,7 @@ module es {
* 获取类型为T的全局管理器
* @param type
*/
public static getGlobalManager<T extends es.GlobalManager>(type): T {
public static getGlobalManager<T extends es.GlobalManager>(type: new (...args) => T): T {
for (let i = 0; i < this._instance._globalManagers.length; i++) {
if (this._instance._globalManagers[i] instanceof type)
return this._instance._globalManagers[i] as T;