* 通过类型获取System实例 * * @param systemType System类型 * @returns System实例,如果未找到则返回null * * @example * ```typescript * const physics = scene.getSystem(PhysicsSystem); * if (physics) { * physics.doSomething(); * } * ```
(systemType: ServiceType<T>)
| 343 | * ``` |
| 344 | */ |
| 345 | public getSystem<T extends EntitySystem>(systemType: ServiceType<T>): T | null { |
| 346 | return this._services.tryResolve(systemType) as T | null; |
| 347 | } |
| 348 | |
| 349 | /** |
| 350 | * 标记系统顺序为脏 |
no test coverage detected