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

Method setScene

packages/core/src/Core.ts:326–333  ·  view source on GitHub ↗

* @zh 设置当前场景 * @en Set current scene * * @param scene - @zh 要设置的场景 @en The scene to set * @returns @zh 设置的场景实例 @en The scene instance that was set * * @example * ```typescript * Core.create({ debug: true }); * * // @zh 创建并设置场景 | @en Create and set sc

(scene: T)

Source from the content-addressed store, hash-verified

324 * ```
325 */
326 public static setScene<T extends IScene>(scene: T): T {
327 if (!this._instance) {
328 Core._logger.warn('Core实例未创建,请先调用Core.create()');
329 throw new Error('Core实例未创建');
330 }
331
332 return this._instance._sceneManager.setScene(scene);
333 }
334
335 /**
336 * @zh 获取当前场景

Callers

nothing calls this directly

Calls 2

setSceneMethod · 0.65
warnMethod · 0.45

Tested by

no test coverage detected