Починен зелёный экран: все узлы были не на том слое
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:
@@ -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`.
|
||||
|
||||
@@ -159,3 +159,15 @@ rules leave only one unanswered attack at a time. Putting it in the core means
|
||||
the one piece of interface logic that can silently reject a legal move is covered
|
||||
by headless tests, including a property test that it never proposes an action the
|
||||
rules would refuse.
|
||||
|
||||
## 2026-09-13 · Presentation · The loader reports every step it takes
|
||||
|
||||
**Decision.** `Bootstrap` writes each stage to the on-screen label and to the
|
||||
console, and falls through to the lobby after ten seconds even if the art
|
||||
preload never calls back.
|
||||
|
||||
**Why.** The first build ran but showed nothing but a green screen, because
|
||||
every node authored through the editor tools had been left on the DEFAULT layer
|
||||
while the camera only renders UI_2D (see CODE_MODE_SETUP.md). A blank screen
|
||||
carries no information about which step failed, and a loader that can hang
|
||||
forever on an asset the lobby does not even need is a dead end for no reason.
|
||||
|
||||
Reference in New Issue
Block a user