新增ServiceContainer服务容器, 所有服务统一实现 IService 接口

This commit is contained in:
YHH
2025-10-10 18:13:28 +08:00
parent 1d2a3e283e
commit 41bbe23404
11 changed files with 702 additions and 33 deletions

View File

@@ -3,6 +3,7 @@ import { ECSFluentAPI, createECSAPI } from './Core/FluentAPI';
import { Time } from '../Utils/Time';
import { Core } from '../Core';
import { createLogger } from '../Utils/Logger';
import type { IService } from '../Core/ServiceContainer';
/**
* 单场景管理器
@@ -46,7 +47,7 @@ import { createLogger } from '../Utils/Logger';
* sceneManager.loadScene(new MenuScene());
* ```
*/
export class SceneManager {
export class SceneManager implements IService {
/**
* 当前活跃场景
*/
@@ -235,4 +236,11 @@ export class SceneManager {
public get hasPendingScene(): boolean {
return this._nextScene !== null;
}
/**
* 释放资源IService接口
*/
public dispose(): void {
this.destroy();
}
}