目录结构
编辑器文件夹结构
Wonderland Editor 安装目录中包含以下文件夹:
bin
包含可执行文件,plugins
包含编辑器插件,magnum
包含场景和图像导入插件(遵循开源 Magnum 图形库定义的接口)。
fonts
存放编辑器使用的字体。
deploy
包含用于部署的文件,例如各种版本的 WebAssembly 运行时。
shaders
包含 Wonderland Engine 提供的默认着色器。您可以在此放置自定义着色器。
js
包含默认的 JavaScript 组件(components
)和库(libs
)。
推荐的项目结构
为了保持项目的有序性,建议采用以下项目结构:
1unnamed-wonderland/
2├── .editor/
3│ └── state.json
4├── cache/
5├── deploy/
6├── raw/
7│ └── audio/
8│ ├── audio_file.wav
9│ └── ...
10├── assets/
11│ ├── models/
12│ │ ├── model_file.blend
13│ │ └── ...
14│ ├── scenes/
15│ │ ├── SceneFile.glb
16│ │ └── ...
17│ └── textures/
18│ ├── texture_file.png
19│ └── ...
20├── js/
21│ ├── components/
22│ │ ├── js-component.js
23│ │ └── ...
24│ ├── lib/
25│ │ ├── js-lib.js
26│ │ └── ...
27│ └── index.js
28├── plugins/
29├── shaders/
30├── static/
31│ └── audio/
32│ ├── audio_file.mp3
33│ └── ...
34├── package.json
35└── UnnamedWonderland.wlp
.editor
存储的是仅限于本地开发者使用的文件。例如,state.json
存储了哪些视图已打开以及哪些调试设置已启用。此文件夹通常不纳入源码控制.
deploy
是 Wonderland Editor 用于打包您的可部署项目的文件夹,同时也是本地服务器提供大部分文件服务的位置。
cache
用于存储需要长时间计算的文件,包括纹理压缩结果、全局光照探针等。
assets
包含所有图形和音频相关的资源文件。
js
包含所有自定义的组件及其所需的 JavaScript 库。
plugins
存放您的自定义插件。
shaders
放置您的自定义着色器。
static
包含将按原样复制到 deploy
的文件。像 static/sounds/mysound.mp3
这样的文件将可以通过 URL sounds/mysound.mp3
来访问。
package.json
列出项目的 JavaScript 包依赖项。
UnnamedWonderland.wlp
是 Wonderland Engine 的主项目文件。