diff --git a/plugins/unity-launcher/CHANGELOG.md b/plugins/unity-launcher/CHANGELOG.md index c267cdeca..c2e1f87c2 100644 --- a/plugins/unity-launcher/CHANGELOG.md +++ b/plugins/unity-launcher/CHANGELOG.md @@ -1,5 +1,2 @@ -## 1.0.4 - 2026-10-22 -1. 编辑器导入支持选择整盘,无固定搜索深度限制,改用异步流式目录扫描。 -2. 项目和编辑器扫描统一提供实时进度、取消操作、不可访问目录统计和错误反馈。 -3. 移除启动和渲染时的调试日志,避免每次唤起都序列化完整项目列表。 -4. 打开项目前自动刷新 `ProjectVersion.txt`,项目升级 Unity 后无需重新导入。 +## 1.0.4 - 2026-11-21 +1. bug修复 \ No newline at end of file diff --git a/plugins/unity-launcher/preload.js b/plugins/unity-launcher/preload.js index 909770740..b0da30d64 100644 --- a/plugins/unity-launcher/preload.js +++ b/plugins/unity-launcher/preload.js @@ -22,12 +22,20 @@ window.services = { // ---------- 统一的分离式启动(带错误处理,避免未捕获的 'error' 事件) ---------- _spawnDetached(exePath, args) { const fs = require('fs'); + const path = require('path'); const { spawn } = require('child_process'); if (!exePath) throw new Error('未指定 Unity.exe 路径'); if (!fs.existsSync(exePath)) throw new Error(`编辑器不存在: ${exePath}`); let child; try { - child = spawn(exePath, args, { detached: true, stdio: 'ignore', windowsHide: true }); + // Unity.exe 是 GUI 程序。windowsHide 会让旧版编辑器加载完成后仍不显示主窗口。 + // 分离进程并忽略标准流即可;编辑器进程必须允许显示自己的窗口。 + child = spawn(exePath, args, { + detached: true, + stdio: 'ignore', + windowsHide: false, + cwd: path.dirname(exePath) + }); } catch (e) { throw new Error(`启动失败: ${e.message}`); }