@esengine/ecs-framework 2.1.47 → 2.1.48
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/index.cjs +2 -2
- package/index.cjs.map +1 -1
- package/index.d.ts +85 -15
- package/index.es5.js +2 -2
- package/index.es5.js.map +1 -1
- package/index.mjs +1 -1
- package/index.mjs.map +1 -1
- package/index.umd.js +1 -1
- package/index.umd.js.map +1 -1
- package/package.json +1 -1
package/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @esengine/ecs-framework v2.1.
|
|
2
|
+
* @esengine/ecs-framework v2.1.48
|
|
3
3
|
* TypeScript definitions
|
|
4
4
|
*/
|
|
5
5
|
/**
|
|
@@ -1483,6 +1483,7 @@ declare class LoggerManager {
|
|
|
1483
1483
|
private static _instance;
|
|
1484
1484
|
private _loggers;
|
|
1485
1485
|
private _defaultLogger;
|
|
1486
|
+
private _defaultLevel;
|
|
1486
1487
|
private constructor();
|
|
1487
1488
|
/**
|
|
1488
1489
|
* 获取日志管理器实例
|
|
@@ -3430,6 +3431,7 @@ declare abstract class EntitySystem implements ISystemBase {
|
|
|
3430
3431
|
private _initialized;
|
|
3431
3432
|
private _matcher;
|
|
3432
3433
|
private _trackedEntities;
|
|
3434
|
+
private _eventListeners;
|
|
3433
3435
|
/**
|
|
3434
3436
|
* 获取系统处理的实体列表(动态查询)
|
|
3435
3437
|
*/
|
|
@@ -3554,7 +3556,7 @@ declare abstract class EntitySystem implements ISystemBase {
|
|
|
3554
3556
|
*
|
|
3555
3557
|
* @param entities 要处理的实体列表
|
|
3556
3558
|
*/
|
|
3557
|
-
protected process(
|
|
3559
|
+
protected process(entities: Entity[]): void;
|
|
3558
3560
|
/**
|
|
3559
3561
|
* 后期处理实体列表
|
|
3560
3562
|
*
|
|
@@ -3611,7 +3613,7 @@ declare abstract class EntitySystem implements ISystemBase {
|
|
|
3611
3613
|
*
|
|
3612
3614
|
* @param entity 被添加的实体
|
|
3613
3615
|
*/
|
|
3614
|
-
protected onAdded(
|
|
3616
|
+
protected onAdded(entity: Entity): void;
|
|
3615
3617
|
/**
|
|
3616
3618
|
* 当实体从系统中移除时调用
|
|
3617
3619
|
*
|
|
@@ -3619,7 +3621,38 @@ declare abstract class EntitySystem implements ISystemBase {
|
|
|
3619
3621
|
*
|
|
3620
3622
|
* @param entity 被移除的实体
|
|
3621
3623
|
*/
|
|
3622
|
-
protected onRemoved(
|
|
3624
|
+
protected onRemoved(entity: Entity): void;
|
|
3625
|
+
/**
|
|
3626
|
+
* 添加事件监听器
|
|
3627
|
+
*
|
|
3628
|
+
* 推荐使用此方法而不是直接调用eventSystem.on(),
|
|
3629
|
+
* 这样可以确保系统移除时自动清理监听器,避免内存泄漏。
|
|
3630
|
+
*
|
|
3631
|
+
* @param eventType 事件类型
|
|
3632
|
+
* @param handler 事件处理函数
|
|
3633
|
+
* @param config 监听器配置
|
|
3634
|
+
*/
|
|
3635
|
+
protected addEventListener<T = any>(eventType: string, handler: EventHandler<T>, config?: EventListenerConfig): void;
|
|
3636
|
+
/**
|
|
3637
|
+
* 移除特定的事件监听器
|
|
3638
|
+
*
|
|
3639
|
+
* @param eventType 事件类型
|
|
3640
|
+
* @param handler 事件处理函数
|
|
3641
|
+
*/
|
|
3642
|
+
protected removeEventListener<T = any>(eventType: string, handler: EventHandler<T>): void;
|
|
3643
|
+
/**
|
|
3644
|
+
* 清理所有事件监听器
|
|
3645
|
+
*
|
|
3646
|
+
* 系统移除时自动调用,清理所有通过addEventListener添加的监听器。
|
|
3647
|
+
*/
|
|
3648
|
+
private cleanupEventListeners;
|
|
3649
|
+
/**
|
|
3650
|
+
* 系统销毁时的回调
|
|
3651
|
+
*
|
|
3652
|
+
* 当系统从场景中移除时调用,子类可以重写此方法进行清理操作。
|
|
3653
|
+
* 注意:事件监听器会被框架自动清理,无需手动处理。
|
|
3654
|
+
*/
|
|
3655
|
+
protected onDestroy(): void;
|
|
3623
3656
|
}
|
|
3624
3657
|
|
|
3625
3658
|
/**
|
|
@@ -5019,8 +5052,16 @@ declare class WorldManager {
|
|
|
5019
5052
|
* 实体数据收集器
|
|
5020
5053
|
*/
|
|
5021
5054
|
declare class EntityDataCollector {
|
|
5022
|
-
|
|
5023
|
-
|
|
5055
|
+
/**
|
|
5056
|
+
* 收集实体数据
|
|
5057
|
+
* @param scene 场景实例
|
|
5058
|
+
*/
|
|
5059
|
+
collectEntityData(scene?: IScene | null): IEntityDebugData;
|
|
5060
|
+
/**
|
|
5061
|
+
* 获取原始实体列表
|
|
5062
|
+
* @param scene 场景实例
|
|
5063
|
+
*/
|
|
5064
|
+
getRawEntityList(scene?: IScene | null): Array<{
|
|
5024
5065
|
id: number;
|
|
5025
5066
|
name: string;
|
|
5026
5067
|
active: boolean;
|
|
@@ -5034,9 +5075,18 @@ declare class EntityDataCollector {
|
|
|
5034
5075
|
tag: number;
|
|
5035
5076
|
updateOrder: number;
|
|
5036
5077
|
}>;
|
|
5037
|
-
|
|
5078
|
+
/**
|
|
5079
|
+
* 获取实体详细信息
|
|
5080
|
+
* @param entityId 实体ID
|
|
5081
|
+
* @param scene 场景实例
|
|
5082
|
+
*/
|
|
5083
|
+
getEntityDetails(entityId: number, scene?: IScene | null): any;
|
|
5038
5084
|
private getSceneInfo;
|
|
5039
|
-
|
|
5085
|
+
/**
|
|
5086
|
+
* 收集实体数据(包含内存信息)
|
|
5087
|
+
* @param scene 场景实例
|
|
5088
|
+
*/
|
|
5089
|
+
collectEntityDataWithMemory(scene?: IScene | null): IEntityDebugData;
|
|
5040
5090
|
private collectArchetypeData;
|
|
5041
5091
|
private getArchetypeDistributionFast;
|
|
5042
5092
|
private getTopEntitiesByComponentsFast;
|
|
@@ -5073,8 +5123,11 @@ declare class EntityDataCollector {
|
|
|
5073
5123
|
}>;
|
|
5074
5124
|
/**
|
|
5075
5125
|
* 获取组件的完整属性信息(仅在需要时调用)
|
|
5126
|
+
* @param entityId 实体ID
|
|
5127
|
+
* @param componentIndex 组件索引
|
|
5128
|
+
* @param scene 场景实例
|
|
5076
5129
|
*/
|
|
5077
|
-
getComponentProperties(entityId: number, componentIndex: number): Record<string, any>;
|
|
5130
|
+
getComponentProperties(entityId: number, componentIndex: number, scene?: IScene | null): Record<string, any>;
|
|
5078
5131
|
/**
|
|
5079
5132
|
* 格式化属性值
|
|
5080
5133
|
*/
|
|
@@ -5097,8 +5150,12 @@ declare class EntityDataCollector {
|
|
|
5097
5150
|
private generateObjectId;
|
|
5098
5151
|
/**
|
|
5099
5152
|
* 展开懒加载对象(供调试面板调用)
|
|
5153
|
+
* @param entityId 实体ID
|
|
5154
|
+
* @param componentIndex 组件索引
|
|
5155
|
+
* @param propertyPath 属性路径
|
|
5156
|
+
* @param scene 场景实例
|
|
5100
5157
|
*/
|
|
5101
|
-
expandLazyObject(entityId: number, componentIndex: number, propertyPath: string): any;
|
|
5158
|
+
expandLazyObject(entityId: number, componentIndex: number, propertyPath: string, scene?: IScene | null): any;
|
|
5102
5159
|
/**
|
|
5103
5160
|
* 根据路径获取对象
|
|
5104
5161
|
*/
|
|
@@ -5111,8 +5168,10 @@ declare class EntityDataCollector {
|
|
|
5111
5168
|
declare class SystemDataCollector {
|
|
5112
5169
|
/**
|
|
5113
5170
|
* 收集系统数据
|
|
5171
|
+
* @param performanceMonitor 性能监视器实例
|
|
5172
|
+
* @param scene 场景实例
|
|
5114
5173
|
*/
|
|
5115
|
-
collectSystemData(performanceMonitor: any): ISystemDebugData;
|
|
5174
|
+
collectSystemData(performanceMonitor: any, scene?: IScene | null): ISystemDebugData;
|
|
5116
5175
|
}
|
|
5117
5176
|
|
|
5118
5177
|
/**
|
|
@@ -5153,8 +5212,9 @@ declare class ComponentDataCollector {
|
|
|
5153
5212
|
private static componentSizeCache;
|
|
5154
5213
|
/**
|
|
5155
5214
|
* 收集组件数据(轻量版,不计算实际内存大小)
|
|
5215
|
+
* @param scene 场景实例
|
|
5156
5216
|
*/
|
|
5157
|
-
collectComponentData(): IComponentDebugData;
|
|
5217
|
+
collectComponentData(scene?: IScene | null): IComponentDebugData;
|
|
5158
5218
|
/**
|
|
5159
5219
|
* 获取组件类型的估算内存大小(基于预设值,不进行实际计算)
|
|
5160
5220
|
*/
|
|
@@ -5163,8 +5223,10 @@ declare class ComponentDataCollector {
|
|
|
5163
5223
|
/**
|
|
5164
5224
|
* 为内存快照功能提供的详细内存计算
|
|
5165
5225
|
* 只在用户主动请求内存快照时调用
|
|
5226
|
+
* @param typeName 组件类型名称
|
|
5227
|
+
* @param scene 场景实例
|
|
5166
5228
|
*/
|
|
5167
|
-
calculateDetailedComponentMemory(typeName: string): number;
|
|
5229
|
+
calculateDetailedComponentMemory(typeName: string, scene?: IScene | null): number;
|
|
5168
5230
|
/**
|
|
5169
5231
|
* 估算对象内存大小(仅用于内存快照)
|
|
5170
5232
|
* 优化版本:减少递归深度,提高性能
|
|
@@ -5180,8 +5242,9 @@ declare class SceneDataCollector {
|
|
|
5180
5242
|
private sceneStartTime;
|
|
5181
5243
|
/**
|
|
5182
5244
|
* 收集场景数据
|
|
5245
|
+
* @param scene 场景实例
|
|
5183
5246
|
*/
|
|
5184
|
-
collectSceneData(): ISceneDebugData;
|
|
5247
|
+
collectSceneData(scene?: IScene | null): ISceneDebugData;
|
|
5185
5248
|
/**
|
|
5186
5249
|
* 设置场景开始时间
|
|
5187
5250
|
*/
|
|
@@ -5260,11 +5323,18 @@ declare class DebugManager {
|
|
|
5260
5323
|
private performanceCollector;
|
|
5261
5324
|
private componentCollector;
|
|
5262
5325
|
private sceneCollector;
|
|
5326
|
+
private sceneProvider;
|
|
5327
|
+
private performanceMonitorProvider;
|
|
5263
5328
|
private frameCounter;
|
|
5264
5329
|
private lastSendTime;
|
|
5265
5330
|
private sendInterval;
|
|
5266
5331
|
private isRunning;
|
|
5267
|
-
|
|
5332
|
+
/**
|
|
5333
|
+
* 构造调试管理器
|
|
5334
|
+
* @param core Core实例
|
|
5335
|
+
* @param config 调试配置
|
|
5336
|
+
*/
|
|
5337
|
+
constructor(core: any, config: IECSDebugConfig);
|
|
5268
5338
|
/**
|
|
5269
5339
|
* 启动调试管理器
|
|
5270
5340
|
*/
|