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

Method setWorldActive

packages/core/src/ECS/WorldManager.ts:161–175  ·  view source on GitHub ↗

* 设置World激活状态

(worldName: string, active: boolean)

Source from the content-addressed store, hash-verified

159 * 设置World激活状态
160 */
161 public setWorldActive(worldName: string, active: boolean): void {
162 const world = this._worlds.get(worldName);
163 if (!world) {
164 logger.warn(`World '${worldName}' 不存在`);
165 return;
166 }
167
168 if (active) {
169 world.start();
170 logger.debug(`激活World: ${worldName}`);
171 } else {
172 world.stop();
173 logger.debug(`停用World: ${worldName}`);
174 }
175 }
176
177 /**
178 * 检查World是否激活

Callers 2

Calls 5

getMethod · 0.65
stopMethod · 0.65
warnMethod · 0.45
startMethod · 0.45
debugMethod · 0.45

Tested by

no test coverage detected