Skip to content

A fast 2D and 3D game engine — TypeScript SDK, C++/WebAssembly core, visual editor. Ship one project to web, desktop, WeChat MiniGames, playable ads, and native Android / iOS.

docs(assets): what the scripts name ships; what still needs alwaysInclude

yhh497aac46429c
diff --git a/docs/astro/src/content/docs/assets/overview.mdx b/docs/astro/src/content/docs/assets/overview.mdx
index 4d3d70fd8..cdf23b375 100644
--- a/docs/astro/src/content/docs/assets/overview.mdx
+++ b/docs/astro/src/content/docs/assets/overview.mdx
@@ -184,13 +184,17 @@ way it can:
### Shipping what only code names
-Reachability is what keeps a build from shipping everything — and it is **blind to
-anything your code names at runtime**: a texture in rich-text markup, a clip played
-by url, a prefab spawned by path. Those get culled, and nothing warns you, because
-the editor serves the project straight off disk and never needs the manifest. The
-first symptom is a silent button or a missing image in a real build.
-
-Declare the folder instead. In the **Content Browser**, right-click it and pick
+Reachability is what keeps a build from shipping everything, and it starts at the
+scenes. Your scripts are read too: a string literal that is an asset's whole path
+(`'assets/ui/coin.png'`) or an `@uuid:` ref ships that asset, and a template literal
+that builds paths inside a folder (`` `assets/sfx/${name}.wav` ``) ships the whole
+folder, with a build warning saying so. A shipped game that asks for a file the
+package lacks logs which one and why.
+
+What the scripts cannot show is still culled: a path assembled from pieces, a name
+read from data, a texture in rich-text markup. The editor serves the project straight
+off disk, so the first symptom is a missing image in a real build. For those, declare
+the folder. In the **Content Browser**, right-click it and pick
**Delivery → Always include in builds** — the same menu that sets local /
subpackage / remote delivery, writing to the same `.esengine/asset-groups.json`:
diff --git a/docs/astro/src/content/docs/zh-cn/assets/overview.mdx b/docs/astro/src/content/docs/zh-cn/assets/overview.mdx
index 4b6df25aa..6e7850def 100644
--- a/docs/astro/src/content/docs/zh-cn/assets/overview.mdx
+++ b/docs/astro/src/content/docs/zh-cn/assets/overview.mdx
@@ -160,11 +160,13 @@ const { failed } = await assets.preload(
### 只有代码点名的资产
-可达性分析正是拦住"什么都往包里塞"的东西——而它对**你的代码在运行时才点名的一切是瞎的**:
-富文本标记里的纹理、按 url 播放的音频、按路径 spawn 的预制体。这些会被剔除,而且没有任何警告,
-因为编辑器直接从磁盘伺服项目,压根不需要清单。第一个症状是真实构建里一个没声的按钮或一张缺失的图。
+可达性分析正是拦住"什么都往包里塞"的东西,它从场景出发。脚本也会被读取:字符串字面量如果正好是
+某个资产的完整路径(`'assets/ui/coin.png'`)或 `@uuid:` 引用,该资产就会进包;在某个文件夹里拼路径的
+模板字符串(`` `assets/sfx/${name}.wav` ``)会把整个文件夹带上,并在构建时给出警告。发布后的游戏请求
+包里没有的文件时,会在日志里说明是哪个文件以及原因。
-那就把这个文件夹声明出来。在**内容浏览器**里右键它,选 **交付方式 → 总是打进构建**——
+脚本里看不出来的仍会被剔除:由几段拼出来的路径、从数据里读出的名字、富文本标记里的纹理。编辑器直接
+从磁盘读取项目,所以第一个症状往往是真实构建里缺了一张图。这类情况请把文件夹声明出来。在**内容浏览器**里右键它,选 **交付方式 → 总是打进构建**——
就是那个设置本地 / 分包 / 远端交付的同一个菜单,写进同一份
`.esengine/asset-groups.json`: