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

Method registerSystems

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

* 批量注册EntitySystem到场景(使用DI) * * 自动按照依赖顺序注册多个System。 * 所有System必须使用@Injectable装饰器标记。 * * @param systemTypes System类型数组 * @returns 注册的System实例数组 * * @example * ```typescript * @Injectable() * @ECSSystem('Collision', { updateOrder: 5 }) * clas

(systemTypes: Array<ServiceType<EntitySystem>>)

Source from the content-addressed store, hash-verified

1183 * ```
1184 */
1185 public registerSystems(systemTypes: Array<ServiceType<EntitySystem>>): EntitySystem[] {
1186 const registeredSystems: EntitySystem[] = [];
1187
1188 for (const systemType of systemTypes) {
1189 const system = this.addEntityProcessor(systemType);
1190 registeredSystems.push(system);
1191 }
1192
1193 return registeredSystems;
1194 }
1195
1196 /**
1197 * 添加系统到场景(addEntityProcessor的别名)

Callers

nothing calls this directly

Calls 2

addEntityProcessorMethod · 0.95
pushMethod · 0.65

Tested by

no test coverage detected