Починен зелёный экран: все узлы были не на том слое

nodeCreate кладёт узел на слой DEFAULT, а камера Canvas рисует только
UI_2D. Поэтому сборка показывала цвет очистки камеры и больше ничего.
В редакторе это не видно вообще: камера вида сцены рисует все слои,
так что сцена выглядит правильной, а билд — пустым.

- 45 узлов в обеих сценах и префабе переведены на слой UI_2D
- scripts/check-scenes.mjs: headless-проверка сцен и префабов —
  слои, наличие камеры у Canvas, видимость UI_2D у камеры,
  незаполненные ссылки в наших компонентах. Проверено, что она
  действительно падает на подсунутом неверном слое
- npm run check — всё разом (чистота core, сцены, типы, тесты)
- Bootstrap теперь докладывает каждый шаг в лейбл и в консоль
  и через 10 секунд уходит в лобби даже если арт не догрузился:
  молча висящий загрузчик — худший вид бага в отчёте
- ловушка со слоями описана в docs/CODE_MODE_SETUP.md

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
ftc
2026-09-13 11:58:17 +03:00
co-authored by Claude Opus 5
parent 3a36b698dc
commit 43f5bc5df3
8 changed files with 231 additions and 48 deletions
+23
View File
@@ -120,3 +120,26 @@ CocosEditor.inspectorSetSettingsProperties({
values: [1080, true],
});
```
## Known issue: `nodeCreate` puts nodes on the wrong layer for UI
A node created with `nodeCreate` lands on the **DEFAULT** layer
(`1073741824`). A Canvas camera is normally set to render **UI_2D**
(`33554432`) only, so every node authored through the tools is invisible at
runtime — the camera draws its clear colour and nothing else, which looks like
the game has frozen on a blank coloured screen.
The editor's own "create node" menu assigns UI_2D, so this only bites
automation, and nothing in the editor viewport reveals it: the scene-view camera
renders every layer, so the scene looks perfectly fine while the build does not.
**Always set the layer after creating a UI node:**
```js
const UI_2D = 33554432;
CocosEditor.inspectorSetInstanceProperties({
reference: newNode, propertyPaths: ['layer'], values: [UI_2D],
});
```
To check a whole scene, walk `nodeGetTree` and assert every node's `layer`.