docs: add separate EN/CN editor setup guides

This commit is contained in:
yhh
2025-12-30 10:01:33 +08:00
parent 2e3889abed
commit e2598b2292
7 changed files with 614 additions and 616 deletions

View File

@@ -282,7 +282,7 @@ pnpm test
- [ECS Framework Guide](./packages/framework/core/README.md)
- [Behavior Tree Guide](./packages/framework/behavior-tree/README.md)
- [Editor Setup Guide](./packages/editor/editor-app/README.md)
- [Editor Setup Guide](./packages/editor/editor-app/README.md) ([中文](./packages/editor/editor-app/README_CN.md))
- [API Reference](https://esengine.cn/api/README)
## Community

View File

@@ -282,7 +282,7 @@ pnpm test
- [ECS 框架指南](./packages/framework/core/README.md)
- [行为树指南](./packages/framework/behavior-tree/README.md)
- [编辑器启动指南](./packages/editor/editor-app/README.md)
- [编辑器启动指南](./packages/editor/editor-app/README_CN.md) ([English](./packages/editor/editor-app/README.md))
- [API 参考](https://esengine.cn/api/README)
## 社区

View File

@@ -1,26 +1,22 @@
# ESEngine Editor
ESEngine 可视化编辑器,基于 Tauri 2.x + React 18 构建的跨平台桌面应用。
A cross-platform desktop visual editor built with Tauri 2.x + React 18.
## Prerequisites | 前置条件
## Prerequisites
Before running the editor, ensure you have the following installed:
运行编辑器前,请确保已安装以下环境:
- **Node.js** >= 18.x
- **pnpm** >= 10.x
- **Rust** >= 1.70 (for Tauri)
- **Platform-specific dependencies**:
- **Windows**: Microsoft Visual Studio C++ Build Tools
- **macOS**: Xcode Command Line Tools (`xcode-select --install`)
- **Linux**: `webkit2gtk`, `libgtk-3-dev`, `libappindicator3-dev` (see [Tauri prerequisites](https://tauri.app/v1/guides/getting-started/prerequisites))
- **Linux**: See [Tauri prerequisites](https://tauri.app/v1/guides/getting-started/prerequisites)
## Quick Start | 快速启动
## Quick Start
### 1. Clone and Install | 克隆并安装
### 1. Clone and Install
```bash
git clone https://github.com/esengine/esengine.git
@@ -28,117 +24,71 @@ cd esengine
pnpm install
```
### 2. Build Dependencies | 构建依赖
### 2. Clone Physics Dependencies (Optional)
Build the required packages before running the editor:
在运行编辑器前,先构建所需的依赖包:
If you need physics support, clone the rapier.js dependency:
```bash
# Build all editor dependencies
pnpm --filter @esengine/editor-app... build
git clone https://github.com/esengine/rapier.js.git packages/thirdparty/rapier.js
```
### 3. Run in Development Mode | 开发模式运行
### 3. Build Dependencies
From the project root:
```bash
pnpm build:editor
```
### 4. Run Editor
```bash
cd packages/editor/editor-app
pnpm tauri:dev
```
This will:
1. Build the editor SDK (`@esengine/editor-runtime`)
2. Copy engine modules to the editor
3. Start Tauri in development mode with hot-reload
这将会:
1. 构建编辑器 SDK (`@esengine/editor-runtime`)
2. 复制引擎模块到编辑器
3. 以热重载的开发模式启动 Tauri
### 4. Build for Production | 生产构建
```bash
cd packages/editor/editor-app
pnpm tauri:build
```
The built application will be in `src-tauri/target/release/`.
构建的应用程序将位于 `src-tauri/target/release/` 目录。
## Available Scripts | 可用脚本
## Available Scripts
| Script | Description |
|--------|-------------|
| `pnpm tauri:dev` | Run editor in development mode with hot-reload |
| `pnpm tauri:build` | Build production application |
| `pnpm build` | Build web assets only (without Tauri) |
| `pnpm build:sdk` | Build editor-runtime SDK |
| `pnpm copy-modules` | Copy engine modules to editor |
| `pnpm bundle:runtime` | Bundle runtime for production |
## Project Structure | 项目结构
## Project Structure
```
editor-app/
├── src/ # React application source
│ ├── components/ # UI components
│ ├── panels/ # Editor panels (Hierarchy, Inspector, etc.)
── services/ # Core services
│ └── styles/ # CSS styles
│ ├── panels/ # Editor panels
── services/ # Core services
├── src-tauri/ # Tauri (Rust) backend
│ ├── src/ # Rust source code
│ └── tauri.conf.json # Tauri configuration
├── public/ # Static assets
── scripts/ # Build scripts
├── index.html # Entry HTML
├── vite.config.ts # Vite configuration
└── package.json
── scripts/ # Build scripts
```
## Troubleshooting | 故障排除
## Troubleshooting
### Build Errors | 构建错误
If you encounter build errors, try:
如果遇到构建错误,请尝试:
### Build Errors
```bash
# Clean and rebuild all packages
pnpm clean
pnpm install
pnpm --filter @esengine/editor-app... build
pnpm build:editor
```
### Rust/Tauri Errors | Rust/Tauri 错误
Ensure Rust toolchain is up to date:
确保 Rust 工具链是最新的:
### Rust/Tauri Errors
```bash
rustup update
```
### Module Not Found | 模块未找到
If engine modules are not found, manually copy them:
如果找不到引擎模块,手动复制它们:
```bash
cd packages/editor/editor-app
pnpm copy-modules
```
## Documentation | 文档
## Documentation
- [ESEngine Documentation](https://esengine.cn/)
- [Tauri Documentation](https://tauri.app/)
- [React Documentation](https://react.dev/)
## License | 许可证
## License
MIT License - see [LICENSE](../../../LICENSE) for details.
MIT License

View File

@@ -0,0 +1,94 @@
# ESEngine 编辑器
基于 Tauri 2.x + React 18 构建的跨平台桌面可视化编辑器。
## 环境要求
运行编辑器前,请确保已安装以下环境:
- **Node.js** >= 18.x
- **pnpm** >= 10.x
- **Rust** >= 1.70 (Tauri 需要)
- **平台相关依赖**
- **Windows**: Microsoft Visual Studio C++ Build Tools
- **macOS**: Xcode Command Line Tools (`xcode-select --install`)
- **Linux**: 参考 [Tauri 环境配置](https://tauri.app/v1/guides/getting-started/prerequisites)
## 快速开始
### 1. 克隆并安装
```bash
git clone https://github.com/esengine/esengine.git
cd esengine
pnpm install
```
### 2. 克隆物理依赖(可选)
如果需要物理引擎支持,需要克隆 rapier.js 依赖:
```bash
git clone https://github.com/esengine/rapier.js.git packages/thirdparty/rapier.js
```
### 3. 构建依赖
在项目根目录执行:
```bash
pnpm build:editor
```
### 4. 启动编辑器
```bash
cd packages/editor/editor-app
pnpm tauri:dev
```
## 可用脚本
| 脚本 | 说明 |
|------|------|
| `pnpm tauri:dev` | 开发模式运行编辑器(支持热重载)|
| `pnpm tauri:build` | 构建生产版本应用 |
| `pnpm build:sdk` | 构建 editor-runtime SDK |
## 项目结构
```
editor-app/
├── src/ # React 应用源码
│ ├── components/ # UI 组件
│ ├── panels/ # 编辑器面板
│ └── services/ # 核心服务
├── src-tauri/ # Tauri (Rust) 后端
├── public/ # 静态资源
└── scripts/ # 构建脚本
```
## 常见问题
### 构建错误
```bash
pnpm clean
pnpm install
pnpm build:editor
```
### Rust/Tauri 错误
```bash
rustup update
```
## 文档
- [ESEngine 文档](https://esengine.cn/)
- [Tauri 文档](https://tauri.app/)
## 许可证
MIT License

View File

@@ -9,7 +9,7 @@
"build": "npm run build:sdk && tsc && vite build",
"build:watch": "vite build --watch",
"tauri": "tauri",
"copy-modules": "node ../../scripts/copy-engine-modules.mjs",
"copy-modules": "node ../../../scripts/copy-engine-modules.mjs",
"tauri:dev": "npm run build:sdk && npm run copy-modules && tauri dev",
"bundle:runtime": "node scripts/bundle-runtime.mjs",
"tauri:build": "npm run build:sdk && npm run copy-modules && npm run bundle:runtime && tauri build",

File diff suppressed because it is too large Load Diff

View File

@@ -10,16 +10,16 @@ name = "ecs_editor_lib"
crate-type = ["staticlib", "cdylib", "rlib"]
[build-dependencies]
tauri-build = { version = "2.0", features = [] }
tauri-build = { version = "2", features = [] }
[dependencies]
tauri = { version = "2.0", features = ["protocol-asset"] }
tauri-plugin-shell = "2.0"
tauri-plugin-dialog = "2.0"
tauri-plugin-fs = "2.0"
tauri = { version = "2", features = ["protocol-asset"] }
tauri-plugin-shell = "2"
tauri-plugin-dialog = "2"
tauri-plugin-fs = "2"
tauri-plugin-updater = "2"
tauri-plugin-http = "2.0"
tauri-plugin-cli = "2.0"
tauri-plugin-http = "2"
tauri-plugin-cli = "2"
serde = { version = "1", features = ["derive"] }
serde_json = "1"
glob = "0.3"