From 6bcfd48a2f100a096165dccbd01d2ae7e0368138 Mon Sep 17 00:00:00 2001 From: YHH <359807859@qq.com> Date: Thu, 16 Oct 2025 12:21:18 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B8=85=E7=90=86=E8=B0=83=E8=AF=95=E6=97=A5?= =?UTF-8?q?=E5=BF=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/components/EntityInspector.tsx | 3 --- .../editor-app/src/components/SceneHierarchy.tsx | 5 ----- .../editor-app/src/services/ProfilerService.ts | 16 +--------------- .../src/Services/ComponentLoaderService.ts | 13 ------------- 4 files changed, 1 insertion(+), 36 deletions(-) diff --git a/packages/editor-app/src/components/EntityInspector.tsx b/packages/editor-app/src/components/EntityInspector.tsx index 2786c67e..2b292d43 100644 --- a/packages/editor-app/src/components/EntityInspector.tsx +++ b/packages/editor-app/src/components/EntityInspector.tsx @@ -36,7 +36,6 @@ export function EntityInspector({ entityStore: _entityStore, messageHub }: Entit const handleEntityDetails = (event: Event) => { const customEvent = event as CustomEvent; const details = customEvent.detail; - console.log('[EntityInspector] Received entity details:', details); setRemoteEntityDetails(details); }; @@ -61,9 +60,7 @@ export function EntityInspector({ entityStore: _entityStore, messageHub }: Entit return; } - console.log('Attempting to create component:', componentName); const component = componentRegistry.createInstance(componentName); - console.log('Created component:', component); if (component) { selectedEntity.addComponent(component); diff --git a/packages/editor-app/src/components/SceneHierarchy.tsx b/packages/editor-app/src/components/SceneHierarchy.tsx index 1501541e..b580f315 100644 --- a/packages/editor-app/src/components/SceneHierarchy.tsx +++ b/packages/editor-app/src/components/SceneHierarchy.tsx @@ -48,19 +48,14 @@ export function SceneHierarchy({ entityStore, messageHub }: SceneHierarchyProps) const profilerService = (window as any).__PROFILER_SERVICE__ as ProfilerService | undefined; if (!profilerService) { - console.warn('[SceneHierarchy] ProfilerService not available'); return; } - console.log('[SceneHierarchy] Subscribing to ProfilerService'); - const unsubscribe = profilerService.subscribe((data) => { const connected = profilerService.isConnected(); - console.log('[SceneHierarchy] Received data, connected:', connected, 'entities:', data.entities?.length || 0); setIsRemoteConnected(connected); if (connected && data.entities && data.entities.length > 0) { - console.log('[SceneHierarchy] Setting remote entities:', data.entities); setRemoteEntities(data.entities); } else { setRemoteEntities([]); diff --git a/packages/editor-app/src/services/ProfilerService.ts b/packages/editor-app/src/services/ProfilerService.ts index 73f7f6eb..3817ff29 100644 --- a/packages/editor-app/src/services/ProfilerService.ts +++ b/packages/editor-app/src/services/ProfilerService.ts @@ -125,8 +125,7 @@ export class ProfilerService { private async startServer(): Promise { try { const port = parseInt(this.wsPort); - const result = await invoke('start_profiler_server', { port }); - console.log('[ProfilerService]', result); + await invoke('start_profiler_server', { port }); this.isServerRunning = true; } catch (error) { console.error('[ProfilerService] Failed to start server:', error); @@ -137,16 +136,13 @@ export class ProfilerService { if (this.ws) return; try { - console.log(`[ProfilerService] Connecting to ws://localhost:${this.wsPort}`); const ws = new WebSocket(`ws://localhost:${this.wsPort}`); ws.onopen = () => { - console.log('[ProfilerService] Connected to profiler server'); this.notifyListeners(this.createEmptyData()); }; ws.onclose = () => { - console.log('[ProfilerService] Disconnected from profiler server'); this.ws = null; // 如果服务器还在运行,尝试重连 @@ -186,7 +182,6 @@ export class ProfilerService { public requestEntityDetails(entityId: number): void { if (!this.ws || this.ws.readyState !== WebSocket.OPEN) { - console.warn('[ProfilerService] Cannot request entity details: WebSocket not connected'); return; } @@ -196,7 +191,6 @@ export class ProfilerService { requestId: `entity_details_${entityId}_${Date.now()}`, entityId }; - console.log('[ProfilerService] Requesting entity details:', request); this.ws.send(JSON.stringify(request)); } catch (error) { console.error('[ProfilerService] Failed to request entity details:', error); @@ -251,7 +245,6 @@ export class ProfilerService { private requestRawEntityList(): void { if (!this.ws || this.ws.readyState !== WebSocket.OPEN) { - console.warn('[ProfilerService] Cannot request entity list: WebSocket not connected'); return; } @@ -260,7 +253,6 @@ export class ProfilerService { type: 'get_raw_entity_list', requestId: `entity_list_${Date.now()}` }; - console.log('[ProfilerService] Requesting entity list:', request); this.ws.send(JSON.stringify(request)); } catch (error) { console.error('[ProfilerService] Failed to request entity list:', error); @@ -269,12 +261,9 @@ export class ProfilerService { private handleRawEntityListResponse(data: any): void { if (!data || !Array.isArray(data)) { - console.warn('[ProfilerService] Invalid raw entity list response:', data); return; } - console.log('[ProfilerService] Received raw entity list, count:', data.length); - const entities: RemoteEntity[] = data.map((e: any) => ({ id: e.id, name: e.name || `Entity ${e.id}`, @@ -298,12 +287,9 @@ export class ProfilerService { private handleEntityDetailsResponse(data: any): void { if (!data) { - console.warn('[ProfilerService] Invalid entity details response:', data); return; } - console.log('[ProfilerService] Received entity details:', data); - const entityDetails: RemoteEntityDetails = { id: data.id, name: data.name || `Entity ${data.id}`, diff --git a/packages/editor-core/src/Services/ComponentLoaderService.ts b/packages/editor-core/src/Services/ComponentLoaderService.ts index 4a8efc27..c20b92fa 100644 --- a/packages/editor-core/src/Services/ComponentLoaderService.ts +++ b/packages/editor-core/src/Services/ComponentLoaderService.ts @@ -28,8 +28,6 @@ export class ComponentLoaderService implements IService { componentInfos: ComponentFileInfo[], modulePathTransform?: (filePath: string) => string ): Promise { - logger.info(`Loading ${componentInfos.length} components`); - const loadedComponents: LoadedComponentInfo[] = []; for (const componentInfo of componentInfos) { @@ -48,7 +46,6 @@ export class ComponentLoaderService implements IService { components: loadedComponents }); - logger.info(`Successfully loaded ${loadedComponents.length} components`); return loadedComponents; } @@ -66,20 +63,15 @@ export class ComponentLoaderService implements IService { if (modulePathTransform) { const modulePath = modulePathTransform(componentInfo.path); - logger.info(`Attempting to load component from: ${modulePath}`); - logger.info(`Looking for export: ${componentInfo.className}`); try { const module = await import(/* @vite-ignore */ modulePath); - logger.info(`Module loaded, exports:`, Object.keys(module)); componentClass = module[componentInfo.className] || module.default; if (!componentClass) { logger.warn(`Component class ${componentInfo.className} not found in module exports`); logger.warn(`Available exports: ${Object.keys(module).join(', ')}`); - } else { - logger.info(`Successfully loaded component class: ${componentInfo.className}`); } } catch (error) { logger.error(`Failed to import component module: ${modulePath}`, error); @@ -108,8 +100,6 @@ export class ComponentLoaderService implements IService { this.loadedComponents.set(componentInfo.path, loadedInfo); - logger.info(`Component ${componentClass ? 'loaded' : 'metadata registered'}: ${componentInfo.className}`); - return loadedInfo; } catch (error) { logger.error(`Failed to load component: ${componentInfo.fileName}`, error); @@ -131,7 +121,6 @@ export class ComponentLoaderService implements IService { this.componentRegistry.unregister(loadedComponent.fileInfo.className); this.loadedComponents.delete(filePath); - logger.info(`Component unloaded: ${loadedComponent.fileInfo.className}`); return true; } @@ -139,7 +128,6 @@ export class ComponentLoaderService implements IService { for (const [filePath] of this.loadedComponents) { this.unloadComponent(filePath); } - logger.info('Cleared all loaded components'); } private convertToModulePath(filePath: string): string { @@ -148,6 +136,5 @@ export class ComponentLoaderService implements IService { public dispose(): void { this.clearLoadedComponents(); - logger.info('ComponentLoaderService disposed'); } }