* 获取当前 ECS 统计信息
()
| 171 | * 获取当前 ECS 统计信息 |
| 172 | */ |
| 173 | public getStats(): ECSDebugStats { |
| 174 | if (!this.worldManager) { |
| 175 | throw new Error('Plugin not installed'); |
| 176 | } |
| 177 | |
| 178 | const scenes: SceneDebugInfo[] = []; |
| 179 | let totalEntities = 0; |
| 180 | let totalSystems = 0; |
| 181 | |
| 182 | const worlds = this.worldManager.getAllWorlds(); |
| 183 | |
| 184 | for (const world of worlds) { |
| 185 | for (const scene of world.getAllScenes()) { |
| 186 | const sceneInfo = this.getSceneInfo(scene); |
| 187 | scenes.push(sceneInfo); |
| 188 | totalEntities += sceneInfo.entityCount; |
| 189 | totalSystems += sceneInfo.systems.length; |
| 190 | } |
| 191 | } |
| 192 | |
| 193 | return { |
| 194 | scenes, |
| 195 | totalEntities, |
| 196 | totalSystems, |
| 197 | timestamp: Date.now() |
| 198 | }; |
| 199 | } |
| 200 | |
| 201 | /** |
| 202 | * 获取场景调试信息 |
no test coverage detected