MCPcopy Create free account
hub / github.com/esengine/esengine / getSystem

Method getSystem

packages/core/src/ECS/Scene.ts:345–347  ·  view source on GitHub ↗

* 通过类型获取System实例 * * @param systemType System类型 * @returns System实例,如果未找到则返回null * * @example * ```typescript * const physics = scene.getSystem(PhysicsSystem); * if (physics) { * physics.doSomething(); * } * ```

(systemType: ServiceType<T>)

Source from the content-addressed store, hash-verified

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 * 标记系统顺序为脏

Callers 15

SceneHierarchyFunction · 0.80
handleCreatePrefabFunction · 0.80
ContentBrowserFunction · 0.80
collectEntityIdsMethod · 0.80
executeMethod · 0.80
executeMethod · 0.80
executeMethod · 0.80
executeMethod · 0.80
undoMethod · 0.80
executeMethod · 0.80
executeMethod · 0.80
undoMethod · 0.80

Calls 1

tryResolveMethod · 0.45

Tested by

no test coverage detected