* 添加全局System * 全局System会在所有激活Scene之前更新
(system: T)
| 301 | * 全局System会在所有激活Scene之前更新 |
| 302 | */ |
| 303 | public addGlobalSystem<T extends IGlobalSystem>(system: T): T { |
| 304 | if (this._globalSystems.includes(system)) { |
| 305 | return system; |
| 306 | } |
| 307 | |
| 308 | this._globalSystems.push(system); |
| 309 | system.initialize?.(); |
| 310 | |
| 311 | logger.debug(`在World '${this.name}' 中添加全局System: ${system.name}`); |
| 312 | return system; |
| 313 | } |
| 314 | |
| 315 | /** |
| 316 | * 移除全局System |
no test coverage detected