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: a page for the History panel, the Scatter Brush and Project Health

yhhafa6781f7c08
diff --git a/docs/astro/astro.config.mjs b/docs/astro/astro.config.mjs
index d26a8f889..870600155 100644
--- a/docs/astro/astro.config.mjs
+++ b/docs/astro/astro.config.mjs
@@ -170,6 +170,7 @@ export default defineConfig({
{ label: 'Play in the Editor', translations: { 'zh-CN': '编辑器内运行' }, slug: 'editor/play' },
{ label: 'Asset Editors', translations: { 'zh-CN': '专用编辑器' }, slug: 'editor/asset-editors' },
{ label: 'Project Settings', translations: { 'zh-CN': '项目设置' }, slug: 'editor/settings' },
+ { label: 'History, Scatter & Health', translations: { 'zh-CN': '历史、散布与健康' }, slug: 'editor/history-scatter-health' },
{ label: 'Keyboard Shortcuts', translations: { 'zh-CN': '键盘快捷键' }, slug: 'editor/shortcuts' },
],
},
diff --git a/docs/astro/src/content/docs/editor/history-scatter-health.mdx b/docs/astro/src/content/docs/editor/history-scatter-health.mdx
new file mode 100644
index 000000000..2a90a3f35
--- /dev/null
+++ b/docs/astro/src/content/docs/editor/history-scatter-health.mdx
@@ -0,0 +1,68 @@
+---
+title: History, Scatter Brush & Project Health
+description: The panels that sit around editing — the History list and how it undoes agent runs, the Scatter Brush for dressing a scene, and Project Health, the pre-build check list.
+---
+
+Three smaller editor tools that the other guides assume you know about. Search the
+Command Palette for any of them.
+
+## History
+
+**History** lists every edit you have made in the open scene, in order, with **Now**
+marking where you are. It is the visible form of Undo / Redo (`Ctrl/⌘ + Z`,
+`Ctrl/⌘ + Shift + Z`): click an earlier row to step back to that state.
+
+A run of the [built-in Agent](/docs/agents/built-in/) folds into **one row**, named
+after the prompt (**Agent · …**). That row has a **Revert** button which takes the
+**whole run** back — the scene edits *and* the project files it wrote. Because files
+are involved, going back past a run asks first and says how many runs and files it
+will undo. This one cannot be redone. Anything too large to hold a copy of is listed
+and left as it is.
+
+After a run, History can offer **Keep this check**: a verification the run passed —
+the scene has nothing flagged, or the scripts compile — that you can pin to the
+project. Every later run is measured against it, and no run can weaken or remove it.
+
+## Scatter Brush
+
+The **Scatter Brush** dresses a scene — rocks, trees, grass tufts — by dragging in the
+viewport instead of placing each copy by hand. Arm it from the Command Palette (**Scatter Brush**); its panel opens on the left. Arming it again, or pressing `Esc`, puts it away.
+
+1. Select the entity to scatter and press **Use Selected** (**Source** shows what is
+ armed). Without a source the panel says *Select an entity to scatter*.
+2. Set the **Brush**:
+
+ | Setting | What it does |
+ |---|---|
+ | **Radius** | How wide a disc one stroke dabs. |
+ | **Density** | How many copies fall inside the disc. |
+ | **Spacing** | The minimum gap between copies, so they never pile up. |
+ | **Scale Variation** | Random size spread per copy. |
+ | **Random Turn** | Random facing per copy. |
+
+ The preview shows one sample: the disc, the copies it would drop, and the spacing
+ each keeps.
+3. Drag in the viewport. Each stroke is **one undo step** and reports *Scattered N*.
+
+The **Scatter Around** command fills the spot the selection stands on without a
+stroke — "more of this, here".
+
+## Project Health
+
+**Project Health** is the checklist the editor runs over the project before you build, and
+the same one **Build → Package Project…** runs first — a blocker stops the build. It
+covers things like asset references that resolve to nothing, an empty required field
+on a component, a missing entry scene, scripts that do not compile, unsaved changes
+that would not be in the build, a target that cannot be built on this machine, and
+viewport fallbacks (HDR, MSAA). It sits in the bottom dock and groups what it found:
+
+- **Blocks the build** — fix before packaging.
+- **Warnings** and **Notes** — worth a look, not fatal.
+- **Could not be checked** — the editor lacked what it needed (a connected device, a
+ toolchain); this is not a pass.
+
+Some entries carry a **Fix** button that applies the repair for you; if it cannot, the
+panel says why. **Re-check** runs it again, and the panel tells you when the project
+changed since the last check. A clean result reads *Nothing is standing in the way of
+a build.* The same list is available to automation as `get_project_health` in the
+[editor MCP](/docs/agents/mcp/).
diff --git a/docs/astro/src/content/docs/zh-cn/editor/history-scatter-health.mdx b/docs/astro/src/content/docs/zh-cn/editor/history-scatter-health.mdx
new file mode 100644
index 000000000..1a5dcef07
--- /dev/null
+++ b/docs/astro/src/content/docs/zh-cn/editor/history-scatter-health.mdx
@@ -0,0 +1,54 @@
+---
+title: 历史、散布笔刷与项目健康
+description: 编辑周边的几个面板——历史列表及它如何撤回 Agent 的整次运行、用来装饰场景的散布笔刷,以及构建前的检查清单“项目健康”。
+---
+
+三个较小的编辑器工具,其他指南默认你已经知道它们。都可以在命令面板里搜到。
+
+## 历史
+
+**历史**按顺序列出你在当前场景里做过的每一次编辑,**当前状态**标出你现在的位置。它是撤销 / 重做
+(`Ctrl/⌘ + Z`、`Ctrl/⌘ + Shift + Z`)的可视化形式:点一个更早的行就回到那个状态。
+
+[内置 Agent](/docs/zh-cn/agents/built-in/)的一次运行会折叠成**一行**,以提示词命名(**Agent · …**)。
+这一行有**撤回**按钮,把**整次运行**退回——场景改动*和*它写下的项目文件都会退回。
+因为牵涉文件,退回前会先确认,并说明将撤销多少次运行、多少个文件。这个操作无法重做;
+太大而没法留副本的文件会被列出,并保持原样。
+
+运行之后,历史还可能给出**保留这条检查**:这次运行通过的某项验证——场景里没有标出问题,或脚本能编译——
+你可以把它钉进项目。之后每次运行都以它为准,任何一次运行都不能削弱或移除它。
+
+## 散布笔刷
+
+**散布笔刷**用在视口里拖动的方式装饰场景——石头、树、草丛——而不是一个个手动摆放。
+从命令面板(**散布笔刷**)启用,它的面板在左侧打开;再次启用或按 `Esc` 收起。
+
+1. 选中要散布的实体,点**用当前选中**(**散布源**显示当前装填的对象)。没有散布源时面板会提示*先选中要散布的实体*。
+2. 设置**笔刷**:
+
+ | 设置 | 作用 |
+ |---|---|
+ | **半径** | 一笔点出的圆盘有多大。 |
+ | **密度** | 圆盘里落下多少个副本。 |
+ | **最小间距** | 副本之间的最小距离,避免堆叠。 |
+ | **大小变化** | 每个副本的随机缩放幅度。 |
+ | **随机朝向** | 每个副本的随机朝向。 |
+
+ 预览显示一次采样:笔刷圆、会落下的副本,以及每个副本留出的间距。
+3. 在视口里拖动。每一笔是**一个撤销步骤**,并提示*散布了 N 个*。
+
+**围绕选中散布**命令不用拖动,直接在选中对象所在的位置补一批——"这里再来点这个"。
+
+## 项目健康
+
+**项目健康**是编辑器在构建前对项目运行的检查清单,**构建 → 打包项目…** 开始前也会先跑同一份——有阻塞项就不会构建。
+它检查的内容包括:指向空的资产引用、组件必填字段为空、缺少入口场景、脚本无法编译、
+不会进入构建的未保存改动、本机无法构建的目标平台,以及视口回退(HDR、MSAA)。它停靠在底部,并把结果分组:
+
+- **阻塞构建**——打包前必须修。
+- **警告**与**提示**——值得看一眼,但不致命。
+- **无法检查**——编辑器缺少所需条件(已连接的设备、工具链);这不等于通过。
+
+有些条目带**修复**按钮,直接替你应用修复;做不到时面板会说明原因。**重新检查**再跑一遍,
+自上次检查后项目有改动时面板也会提醒。结果干净时显示*没有任何东西阻碍构建。*
+同一份清单在[编辑器 MCP](/docs/zh-cn/agents/mcp/)里以 `get_project_health` 提供给自动化。