scenario-unity-web

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Unity Web (web specialist)

Unity Web(Web 专家)

Expert level on the Web means the build is judged where players get it: bytes until gameplay starts, served by the real host with the right headers, loaded in a real browser that reports which graphics API ran, how big the heap grew, and that the page and the game talk. The stance: the host picks the compression, the budget is measured to the first playable moment, and nothing counts until a served build loads headless with zero errors and a screenshot you looked at. Target: Unity 6000.3.21f1, URP 17.3, Chrome headless on macOS. If a sibling skill named here is missing from your available skills, ask the user to install it (
npx skills add scenario-labs/skills --skill <name>
); unattended, proceed from tool schemas and flag the gap.
REQUIRED BACKGROUND: scenario-unity-expert (channels, review loop, 6.3 traps). Toolkit:
ut_env
,
ut_run
(incl.
build(P, "web")
,
run_tests
),
ut_review
, plus this skill's
scripts/ut_web.py
,
scripts/AgentKit/Web/WebJobs.cs
and
scripts/WebRuntime/
(bridge,
.jslib
, error reporter, template).
Web 方面的专家级能力意味着,最终评判必须发生在玩家实际获取游戏的真实环境中:统计直到开始游玩前传输的字节数,确认真实托管端返回了正确的 headers,在真实浏览器中加载并报告实际运行的 graphics API、heap 增长情况,以及页面与游戏能否正常通信。原则是:压缩方式由托管端决定;预算按首次可玩时刻衡量;在托管的 build 通过 headless 加载且零错误、并由人查看过截图之前,任何结果都不算数。目标环境:Unity 6000.3.21f1、URP 17.3、macOS 上的 Chrome headless。如果这里提到的某个同级 skill 不在可用 skills 中,请要求用户安装(
npx skills add scenario-labs/skills --skill <name>
);在无人值守的情况下,根据 tool schemas 继续操作,并标记该缺口。
必需背景: scenario-unity-expert(channels、review loop、6.3 陷阱)。工具包:
ut_env
、
ut_run
(包括
build(P, "web")
、
run_tests
)、
ut_review
,以及本 skill 的
scripts/ut_web.py
、
scripts/AgentKit/Web/WebJobs.cs
和
scripts/WebRuntime/
(bridge、
.jslib
、error reporter、template)。

Stance (the expert delta)

立场(专家能力的增量)

  1. The host decides compression. Own HTTPS server or CDN: Brotli, fallback off,
    Content-Encoding
    per file,
    application/wasm
    on every
    .wasm*
    (6.3 Manual). Plain HTTP: gzip (Chrome refused Brotli at a LAN address,
    ERR_CONTENT_DECODING_FAILED
    , observed;
    localhost
    is exempt). itch.io: Decompression Fallback on (Max O'Didily 8iApGVX--B0 [00:01:40]). Poki: Disabled.
  2. Budget bytes to gameplay start. CrazyGames counts the initial download until the first
    gameplayStart
    : 20 MB for the mobile homepage, 50 MB otherwise, 1,500 files. Deferred content must be requested after that moment (network log proves it). Preload tags only for bundles the first playable moment needs: they move bytes into the counted window (observed +0.84 MB before start).
  3. Load time is the metric; past broadband the binary and CPU dominate. -25 percent load time gave +50 percent sessions (Craven, LlE35onVdmQ [00:08:40]); gains flatten above 86 Mbps [00:11:26]. Measure with CPU throttling and latency; hosting coverage is load time (Loveridge, FYsVftoLBP8 [00:16:12]). Design the wait: a loading card with how-to text, not a bare bar (Craven [00:14:16]), then a tap to play that also unlocks audio.
  4. One thread, one heap, the browser's clock. Every ThreadPool API is an unrecoverable hang: use
    Awaitable
    , coroutines,
    UnityWebRequest
    (observed:
    Task.Run(...).Result
    froze the tab). The heap grows from Initial Memory Size and growth can crash on phones: size Initial from a measured session (observed 32 MB grew to 68 to 74 MB; set to 80, no growth). Leave
    targetFrameRate
    at -1: Unity cannot query the refresh rate (6.3 Manual).
  5. WebGL 2 ships; WebGPU is for compute and falls back silently. Experimental in 6.3 to 6.5, supported but opt-in from 6.6. Keep WebGL 2 below it and log
    SystemInfo.graphicsDeviceType
    (a plain-HTTP page got WebGL 2 with no error, observed). WebGL 2 skins on the CPU (30 characters: 7 fps vs 30 on WebGPU, Duncan 3bu4WZUCGYc [~00:15:13]) and takes non-directional lightmaps only.
  6. The page and the game share a narrow contract.
    .jslib
    in ES5, strings as heap pointers, replies through
    makeDynCall
    into a static
    [MonoPInvokeCallback]
    ,
    SendMessage
    with one JSON string to an exactly named object. Unity takes page-wide keyboard input by default: a page name field received nothing until
    WebGLInput.captureAllKeyboardInput = false
    (observed). No system fonts: CJK and Greek names drew blank while
    Font.HasCharacter
    said present (observed). Portals ignore or rewrite
    index.html
    , so the bridge lives in
    .jslib
    .
  7. What ships is not what you set. Strip Engine Code removes classes only bundles use (
    Could not produce class with ID 182
    , observed; fix: link.xml). Code Optimization and the texture subtarget live in
    Library/
    : a fresh clone reads Shorter Build Time (observed). Safari has no IndexedDB in iframes (6.3 Manual): on itch.io, Safari players may reload everything.
  8. Ship like a live service and cut what does not earn its bytes. Hashed names, previous build kept, 5 percent staged rollout (Loveridge [frame 00:23:29]), symbols and an error collector per release. "If it only improves your game's visual fidelity by one or two percent... it needs to go" [00:11:15]: URP post data cost 1.61 MB here.
  1. 托管端决定压缩方式。 对于自有 HTTPS server 或 CDN:Brotli、关闭 fallback、逐文件设置
    Content-Encoding
    ,并为每个
    .wasm*
    设置
    application/wasm
    (6.3 Manual)。普通 HTTP:gzip(实测 Chrome 曾拒绝 LAN 地址上的 Brotli,出现
    ERR_CONTENT_DECODING_FAILED
    ;
    localhost
    除外)。itch.io:开启 Decompression Fallback(Max O'Didily 8iApGVX--B0 [00:01:40])。Poki:禁用。
  2. 按字节数规划首次可玩时刻的预算。 CrazyGames 会把首次
    gameplayStart
    之前的初始下载计入限制:移动端首页为 20 MB,其他页面为 50 MB,最多 1,500 个文件。延迟内容必须在该时刻之后请求(由 network log 证明)。仅对首次可玩时刻所需的 bundles 使用 Preload 标签:它们会把字节移入受统计的时间窗口(实测在开始前增加 0.84 MB)。
  3. 加载时间才是关键指标;进入宽带区间后,二进制体积和 CPU 才是主导因素。 加载时间降低 25% 带来会话数增加 50%(Craven,LlE35onVdmQ [00:08:40]);当带宽超过 86 Mbps 后,收益趋于平缓([00:11:26])。在 CPU throttling 和 latency 条件下进行测量;托管覆盖面的实际表现取决于加载时间(Loveridge,FYsVftoLBP8 [00:16:12])。设计等待体验:使用带操作说明的 loading card,而不是只有一条进度条(Craven [00:14:16]),然后通过 tap to play 进入游戏,同时解锁音频。
  4. 单线程、单 heap,使用浏览器的时钟。 每个 ThreadPool API 都可能导致无法恢复的卡死:应使用
    Awaitable
    、coroutine 和
    UnityWebRequest
    (实测
    Task.Run(...).Result
    冻结了标签页)。heap 会从 Initial Memory Size 开始增长,并可能在手机上崩溃:根据实测 session 设置 Initial(实测从 32 MB 增长到 68~74 MB;设为 80 MB 后不再增长)。将
    targetFrameRate
    保持为 -1:Unity 无法查询刷新率(6.3 Manual)。
  5. WebGL 2 才是当前发布目标;WebGPU 面向 compute,并且会静默回退。 WebGPU 在 6.3~6.5 中为实验性功能,从 6.6 起受支持但需要主动启用。保持 WebGL 2 作为其下层回退,并记录
    SystemInfo.graphicsDeviceType
    (实测普通 HTTP 页面运行 WebGL 2 且没有错误)。WebGL 2 在 CPU 上执行 skinning(30 个角色:WebGL 2 为 7 fps,WebGPU 为 30 fps,Duncan 3bu4WZUCGYc [~00:15:13]),并且只支持 non-directional lightmaps。
  6. 页面与游戏共享一个窄接口契约。
    .jslib
    必须使用 ES5,将字符串作为 heap pointer,通过
    makeDynCall
    调用静态
    [MonoPInvokeCallback]
    ,并使用
    SendMessage
    将一个 JSON 字符串发送给名称完全匹配的对象。Unity 默认捕获整个页面的键盘输入:某个页面 name field 一直收不到输入,直到设置
    WebGLInput.captureAllKeyboardInput = false
    (实测)。不能使用系统字体:CJK 和希腊文名称显示为空白,而
    Font.HasCharacter
    仍返回存在(实测)。Portal 会忽略或重写
    index.html
    ,因此 bridge 应放在
    .jslib
    中。
  7. 实际发布的内容并不等于你在设置中看到的内容。 Strip Engine Code 可能移除仅由 bundles 使用的类(实测出现
    Could not produce class with ID 182
    ;修复方式:link.xml)。Code Optimization 和 texture subtarget 位于
    Library/
    中:全新 clone 会读取 Shorter Build Time(实测)。Safari 的 iframe 中没有 IndexedDB(6.3 Manual):因此在 itch.io 上,Safari 玩家可能需要重新加载全部内容。
  8. 像发布线上服务一样交付,并删掉不值得占用字节的内容。 使用 hashed names,保留 previous build,执行 5% staged rollout(Loveridge [frame 00:23:29]),并为每次发布保留 symbols 和 error collector。“如果它只能将游戏的视觉保真度提升百分之一或二……那它就应该被移除” [00:11:15]:这里的 URP post data 占用 1.61 MB。

Establish first

首先确认

Ask once: every host or portal (compression, fallback, page ownership, iframe); audience and browser floor (WebAssembly 2023 needs Safari 16.4+, Chrome 91+, Firefox 89+, while Unity supports iOS Safari 15; CrazyGames disables Unity on iOS by default); budget in bytes to gameplay start and seconds at a stated line speed and region; 2D or 3D, URP, lightmaps, skinned crowds; compute need (WebGPU); the page API and any page text fields; scripts player text can use (fonts); desktop and mobile (dual DXT/ASTC data); audio (first tap); Unity version. Defaults: WebGL 2 only; own HTTPS + Brotli; 20 MB portal mobile, 30 MB otherwise (Loveridge [00:03:29]); Explicitly Thrown; WebAssembly 2023 on; Disk Size while iterating, Disk Size with LTO for release; Maximum Memory 2048 MB, Initial from measurement; DPR 1 on phones;
targetFrameRate
-1.
一次性询问:所有 host 或 portal(compression、fallback、page ownership、iframe);受众与 browser floor(WebAssembly 2023 需要 Safari 16.4+、Chrome 91+、Firefox 89+,而 Unity 支持 iOS Safari 15;CrazyGames 默认在 iOS 上禁用 Unity);在指定线路速度和区域下,直到首次可玩时刻的字节预算与秒数;2D 或 3D、URP、lightmaps、skinned crowds;是否需要 compute(WebGPU);页面 API 及任何页面 text fields;玩家文本可使用的 scripts(fonts);desktop 和 mobile(双 DXT/ASTC 数据);音频(首次 tap);Unity version。默认值:仅使用 WebGL 2;自有 HTTPS + Brotli;portal mobile 为 20 MB,其他场景为 30 MB(Loveridge [00:03:29]);Explicitly Thrown;开启 WebAssembly 2023;迭代时使用 Disk Size,发布时使用 Disk Size with LTO;Maximum Memory 为 2048 MB,Initial 根据测量结果设置;手机端 DPR 为 1;
targetFrameRate
为 -1。

Workflow

工作流

  1. Preflight and audit.
    ReadSettings
    ,
    AuditWeb
    (scenes, lighting, skinning, stripping, splash, post data, imports),
    ut_web.scan_hang_apis
    (hangs,
    targetFrameRate
    ),
    scan_jslib
    ,
    package_report
    . GATE: zero audit errors; non-empty valid scene list (Cam Ayres bF_eUuxGEcA [00:04:02]); every costly package justified.
  2. Settings per host.
    WebJobs.ApplySettings
    with a preset (
    own-https
    ,
    plain-http
    ,
    itch
    ,
    poki
    ,
    crazygames
    ,
    dev
    ), always passing
    code_optimization
    and
    texture_subtarget
    ; launch with
    build_target="WebGL"
    .
    write_policy
    plus
    WebReleasePolicyTests
    (EditMode) guard CI. GATE: readback and 8 policy tests pass.
  3. Interop.
    ut_web.install_runtime(P)
    ; wire
    WebBridge
    ,
    WebLeaderboard
    ,
    WebErrorReporter
    (full code in procedures P3). GATE: 0 compile errors, scans clean, bridge object named as the page calls it.
  4. Build.
    ut_run.build(P, "web", out=...)
    . Bundles:
    WriteBundleLinkXml
    first. GATE: Succeeded, file set matches settings,
    size_report
    recorded,
    build_log_report
    read (rank there, judge by bytes on disk).
  5. Serve and audit headers.
    serve
    ,
    header_audit
    locally, then on the real host. GATE: zero errors; bytes sent equal bytes on disk.
  6. Load in Chrome.
    browser_check(..., metrics_seconds=8, reload=True)
    with the page mock. GATE:
    ready
    ,
    gameplay_start
    , feature events; zero banners, zero unexpected console errors; intended
    ready.api
    ; deferred requests after start; heap did not grow on mobile settings; fps steady; warm reload fetches no
    .data
    body (304 allowed); screenshot opened.
  7. Budget and load time.
    budget_check
    ; throttled load (20 Mbps, 40 ms, CPU x4) and a 250 ms run for far regions. GATE: pass with headroom.
  8. Variants. itch (fallback, zip, iframe host), portal SDK, WebGPU on secure and insecure origins, dual DXT/ASTC (
    merge_texture_variants
    ), phone emulation (DPR cap). GATE per variant as in 5 to 7.
  9. Release. Disk Size with LTO, symbols archived,
    AGENTWEB_ERROR_URL
    or
    WebErrorReporter.endpoint
    set, previous build kept, rollout plan (P12). Handoff packet with Verified and Assumed.
  1. 预检与审计。 执行
    ReadSettings
    、
    AuditWeb
    (scenes、lighting、skinning、stripping、splash、post data、imports)、
    ut_web.scan_hang_apis
    (hangs、
    targetFrameRate
    )、
    scan_jslib
    、
    package_report
    。门槛:审计零错误;scene list 非空且有效(Cam Ayres bF_eUuxGEcA [00:04:02]);每个成本高昂的 package 都有明确理由。
  2. 按 host 设置。 使用 preset 调用
    WebJobs.ApplySettings
    (
    own-https
    、
    plain-http
    、
    itch
    、
    poki
    、
    crazygames
    、
    dev
    ),始终传入
    code_optimization
    和
    texture_subtarget
    ;启动时使用
    build_target="WebGL"
    。通过
    write_policy
    和
    WebReleasePolicyTests
    (EditMode)保护 CI。门槛:readback 和 8 项 policy tests 通过。
  3. 互操作。 执行
    ut_web.install_runtime(P)
    ;连接
    WebBridge
    、
    WebLeaderboard
    、
    WebErrorReporter
    (完整代码见 procedures P3)。门槛:0 个编译错误,扫描结果干净,bridge object 的名称与页面调用名称一致。
  4. 构建。 执行
    ut_run.build(P, "web", out=...)
    。Bundles:先执行
    WriteBundleLinkXml
    。门槛:状态为 Succeeded,文件集与 settings 一致,记录
    size_report
    ,并读取
    build_log_report
    (在其中排序,以磁盘上的字节数为准)。
  5. 托管并审计 headers。 先在本地执行
    serve
    、
    header_audit
    ,然后在真实 host 上执行。门槛:零错误;发送的字节数等于磁盘上的字节数。
  6. 在 Chrome 中加载。 使用页面 mock 执行
    browser_check(..., metrics_seconds=8, reload=True)
    。门槛:出现
    ready
    、
    gameplay_start
    和 feature events;零 banner、零意外 console error;使用预期的
    ready.api
    ;延迟请求发生在开始之后;mobile settings 下 heap 没有增长;fps 稳定;warm reload 不再获取
    .data
    body(允许 304);已打开 screenshot。
  7. 预算与加载时间。 执行
    budget_check
    ;进行 throttled load(20 Mbps、40 ms、CPU x4),并针对远端区域执行 250 ms run。门槛:测试通过且留有余量。
  8. 变体。 测试 itch(fallback、zip、iframe host)、portal SDK、安全和不安全 origin 上的 WebGPU、双 DXT/ASTC(
    merge_texture_variants
    )、手机模拟(DPR cap)。每个变体均按步骤 5~7 中的门槛验收。
  9. 发布。 使用 Disk Size with LTO,归档 symbols,设置
    AGENTWEB_ERROR_URL
    或
    WebErrorReporter.endpoint
    ,保留 previous build,并制定 rollout plan(P12)。交付包中应包含 Verified 和 Assumed 清单。

Numbers

数值

ValueRelative toSource
20 / 50 MB, 1,500 filesCrazyGames initial download to first
gameplayStart
(mobile homepage / general)
CrazyGames
30 MBstudio binary rule ("table stakes")Loveridge [00:03:29]
+3.6 / +1 / +0.7 MBURP, URP post-processing, TextMeshPro resourcesCrazyGames tests
9.47 MB, 8.1 srelease demo build (LTO): initial download; time to
gameplay_start
at 20 Mbps, 40 ms, CPU x4
observed
+0.83 ssame load at 250 ms instead of 40 ms latencyobserved
-1.61 MBURP renderer post data off (10.08 to 8.47 MB)observed
32 to 68-74 MBheap growth from the default Initial Memory Size during startup; 80 MB set: no growthobserved
2048 MBMaximum Memory Size; bugs above it before Chrome/Firefox 1196.3 Manual
7 to 30 fps30 skinned characters, WebGL (CPU skinning) vs WebGPUDuncan [~00:15:13]
48 / 86 Mbpsmedian mobile / broadband speed where gains flattenCraven [00:10:53]
More measured values:
references/expert-notes.md
(Numbers, full).
数值相对于来源
20 / 50 MB、1,500 个文件CrazyGames 从首次下载到
gameplayStart
(mobile homepage / general)
CrazyGames
30 MB工作室 binary 体积规则(“table stakes”)Loveridge [00:03:29]
+3.6 / +1 / +0.7 MBURP、URP post-processing、TextMeshPro resourcesCrazyGames tests
9.47 MB、8.1 srelease demo build(LTO):initial download;在 20 Mbps、40 ms、CPU x4 下到达
gameplay_start
的时间
实测
+0.83 s相同 load 在 250 ms latency 而非 40 ms latency 下的耗时实测
-1.61 MB关闭 URP renderer post data(从 10.08 MB 降至 8.47 MB)实测
32 增至 68~74 MB启动期间使用默认 Initial Memory Size 导致的 heap 增长;设为 80 MB 后不再增长实测
2048 MBMaximum Memory Size;在 Chrome/Firefox 119 之前,超过此值会出现 bug6.3 Manual
7 增至 30 fps30 个 skinned characters,WebGL(CPU skinning)与 WebGPU 的对比Duncan [~00:15:13]
48 / 86 Mbps收益趋于平缓时的移动端 / 宽带中位速度Craven [00:10:53]
更多实测值:
references/expert-notes.md
(Numbers、完整内容)。

Quality gates

质量门槛

  • Measurable: readback and policy tests pass; audit and scans clean;
    BuildReport
    Succeeded;
    header_audit
    0 errors on the real host;
    browser_check
    ok with the intended API; deferred after start; heap flat; errors reach the collector;
    budget_check
    pass; throttled load under budget.
  • Visual: canvas screenshot opened: scene rendered, UI legible at 900x500, DPR 1 and a 390 px portrait canvas, a line of every script players can type, loading card and banners readable.
  • 可测量: readback 和 policy tests 通过;审计与扫描结果干净;
    BuildReport
    状态为 Succeeded;真实 host 上的
    header_audit
    为 0 错误;
    browser_check
    返回 ok 且使用预期 API;延迟请求发生在开始之后;heap 保持稳定;错误能够到达 collector;
    budget_check
    通过;throttled load 未超出预算。
  • 视觉: 已打开 canvas screenshot:场景正常渲染;UI 在 900x500 下清晰可读;DPR 1 和 390 px 纵向 canvas 表现正常;每种玩家可输入文字的 script 都展示一行;loading card 和 banners 清晰可读。

Common mistakes

常见错误

MistakeWhat it looks likeFix
Quick local server for a compressed build
SyntaxError
, "Unable to parse ...framework.js.br"
ut_web.serve
or per-suffix
Content-Encoding
Brotli on plain HTTP
ERR_CONTENT_DECODING_FAILED
HTTPS, or gzip + Allow downloads over HTTP
Task.Run
,
HttpClient
, threads, timers
work never runs;
.Result
freezes the tab
Awaitable
, coroutines,
UnityWebRequest
targetFrameRate = 30
"for mobile"
Unity times its own loop against an assumed 60 Hzleave -1; throttle only on purpose
Small Initial Memory with growth on phonesheap 32 to 74 MB at startup; crashes when no contiguous blockInitial = measured peak (
heap_advice
)
High stripping + bundles
Could not produce class with ID
, component missing
WriteBundleLinkXml
, rebuild
Release settings trusted on CIa fresh clone reads Shorter Build Time and the default texture formatset both in every job, or commit a Build Profile
Page field beside the canvaskeystrokes swallowed
WebGLInput.captureAllKeyboardInput = false
(
SetKeyboardCapture
)
Player names in any script, built-in fontblank glyphs;
Font.HasCharacter
still true
ship fallback fonts or draw names in HTML; screenshot each script
Trusting the Graphics API list or version loreWebGPU build running WebGL 2; "WebGPU is production-ready in 6.3"log the API per origin; 6.3 to 6.5 experimental, 6.6 opt-in
{{{ }}}
or ES6 in a
.jslib
build failsES5, no macros in comments (
scan_jslib
)
Page logic in
index.html
for a portal
missing on CrazyGames, rewritten on Poki
.jslib
or the portal SDK
Template defaults shippedShorter Build Time, Minimal stripping, WASM 2023 off: 46 MB raw wasmrelease preset
错误表现修复方式
为压缩 build 快速启动本地 server
SyntaxError
、
Unable to parse ...framework.js.br
使用
ut_web.serve
,或按文件后缀设置
Content-Encoding
在普通 HTTP 上使用 Brotli
ERR_CONTENT_DECODING_FAILED
使用 HTTPS,或使用 gzip + Allow downloads over HTTP
Task.Run
、
HttpClient
、threads、timers
工作永不执行;
.Result
冻结标签页
使用
Awaitable
、coroutine、
UnityWebRequest
为“mobile”设置
targetFrameRate = 30
Unity 按假设的 60 Hz 为自己的循环计时保持 -1;仅在有意时进行 throttle
Initial Memory 较小且在手机上增长启动期间 heap 从 32 MB 增至 74 MB;无法获取连续内存块时崩溃Initial = measured peak(
heap_advice
)
高强度 stripping + bundles
Could not produce class with ID
,组件缺失
WriteBundleLinkXml
,然后重新构建
在 CI 中信任 release settings全新 clone 会读取 Shorter Build Time 和默认 texture format在每个 job 中同时设置两者,或提交 Build Profile
canvas 旁存在页面 field按键输入被吞掉
WebGLInput.captureAllKeyboardInput = false
(
SetKeyboardCapture
)
玩家名称使用任意 script,并使用内置字体字形为空白;
Font.HasCharacter
仍返回 true
提供 fallback fonts,或在 HTML 中绘制名称;为每种 script 截图验证
相信 Graphics API 列表或版本传闻WebGPU build 实际运行 WebGL 2;误认为“WebGPU 在 6.3 已达到 production-ready”按 origin 记录 API;6.3~6.5 为实验性,6.6 起需主动启用
.jslib
中使用
{{{ }}}
或 ES6
构建失败使用 ES5,注释中不要使用 macros(
scan_jslib
)
在 portal 的
index.html
中放置页面逻辑
CrazyGames 中缺失,Poki 中被重写使用
.jslib
或 portal SDK
发布 template defaultsShorter Build Time、Minimal stripping、WebAssembly 2023 off,原始 wasm 达 46 MB使用 release preset

Handoffs

交接

  • Receives from scenario-unity-architecture: code free of hang APIs (scan findings go back); scenario-unity-pipeline-automation: Addressables layout, CI, Build Profiles (this skill supplies the policy tests, LZ4, deferred loading, link.xml); scenario-unity-mobile: ASTC vs DXT, touch, safe areas; scenario-unity-ui: canvas legible at 900x500, DPR 1 and portrait, fallback fonts for player text; scenario-unity-rendering-lighting: a Web URP tier (1 to 2 cascades, lean or no post, non-directional lightmaps or real-time); scenario-unity-shaders and scenario-unity-vfx: WebGPU-safe compute and a WebGL 2 fallback; scenario-unity-performance: frame and memory budgets.
  • Delivers to scenario-unity-expert and the user: build folders per host, header table or server config,
    size_report
    ,
    budget_check
    ,
    browser_check
    evidence (API, events, bytes before start, heap, fps, screenshots), policy file, zip, symbols, Verified and Assumed lists.
  • 接收自 scenario-unity-architecture:不包含 hang APIs 的代码(scan findings 需要回传);scenario-unity-pipeline-automation:Addressables layout、CI、Build Profiles(本 skill 提供 policy tests、LZ4、deferred loading、link.xml);scenario-unity-mobile:ASTC 与 DXT、touch、safe areas;scenario-unity-ui:在 900x500 下清晰可读的 canvas、DPR 1 和纵向布局、玩家文本的 fallback fonts;scenario-unity-rendering-lighting:Web URP tier(1~2 cascades、精简或关闭 post、non-directional lightmaps 或 real-time);scenario-unity-shaders 和 scenario-unity-vfx:WebGPU-safe compute 和 WebGL 2 fallback;scenario-unity-performance:frame 和 memory budgets。
  • 交付给 scenario-unity-expert 和用户:按 host 划分的 build folders、header table 或 server config、
    size_report
    、
    budget_check
    、
    browser_check
    证据(API、events、开始前的字节数、heap、fps、screenshots)、policy file、zip、symbols,以及 Verified 和 Assumed 清单。

Unity 6.3 notes

Unity 6.3 注意事项

  • Menus say "Web", code keeps
    BuildTarget.WebGL
    ,
    PlayerSettings.WebGL
    ,
    UNITY_WEBGL
    ,
    Assets/WebGLTemplates
    ; no public API creates a Build Profile before 6.5.
    WebGLInput
    lives in
    UnityEngine.WebGLModule
    , present only in Web player builds: guard it with
    UNITY_WEBGL && !UNITY_EDITOR
    .
  • URP template ships Brotli, Shorter Build Time, WebAssembly 2023 off, Minimal stripping (observed); WebAssembly 2023 becomes the default in 6.5 (Emscripten 4.0.19; 6.3 reports
    3.1.39-git
    ).
  • WebGPU: experimental and URP-only in 6.3; PSO tracing and Microphone arrive in 6.4; supported, opt-in, Device Filter and compatibility mode in 6.6.
  • The Build Profile's texture compression overrides Player Settings (per-texture overrides beat both) and, like Code Optimization, is stored outside ProjectSettings.
  • unityInstance.GetMetricsInfo()
    (heap, fps, janked frames) works in release builds without the Diagnostics Overlay (whose JS memory reads N/A on Safari and iOS); 6.3 profiles a running Web build over IP; the Frame Debugger does not work on the Web.
  • 菜单中显示为“Web”,代码仍使用
    BuildTarget.WebGL
    、
    PlayerSettings.WebGL
    、
    UNITY_WEBGL
    、
    Assets/WebGLTemplates
    ;在 6.5 之前没有公共 API 可以创建 Build Profile。
    WebGLInput
    位于
    UnityEngine.WebGLModule
    ,仅存在于 Web player builds 中:应使用
    UNITY_WEBGL && !UNITY_EDITOR
    进行保护。
  • URP template 默认附带 Brotli、Shorter Build Time、WebAssembly 2023 off、Minimal stripping(实测);WebAssembly 2023 从 6.5 开始成为默认选项(Emscripten 4.0.19;6.3 报告为
    3.1.39-git
    )。
  • WebGPU 在 6.3 中为实验性功能且仅支持 URP;PSO tracing 和 Microphone 在 6.4 中加入;从 6.6 起受支持,并提供主动启用、Device Filter 和 compatibility mode。
  • Build Profile 的 texture compression 会覆盖 Player Settings(逐纹理 override 的优先级高于二者);它与 Code Optimization 一样,存储在 ProjectSettings 之外。
  • unityInstance.GetMetricsInfo()
    (heap、fps、janked frames)无需 Diagnostics Overlay 即可在 release builds 中使用(Diagnostics Overlay 的 JS memory reads 在 Safari 和 iOS 上为 N/A);6.3 支持通过 IP 分析正在运行的 Web build;Frame Debugger 无法在 Web 上工作。

References

参考资料

  • references/procedures.md
    : 24 procedures with full code (bridge included), live test and recorded result.
  • references/expert-notes.md
    : judgment by expert with timestamps, full numbers, disagreement table.
  • references/critique.md
    : the self-review rubric.
  • references/gui-paths.md
    : the same work through windows and menus.
  • references/sources.md
    : every source, credentials, timestamps, revision history.
  • scripts/ut_web.py
    ,
    scripts/AgentKit/Web/WebJobs.cs
    ,
    scripts/AgentKitOptional/
    (Addressables job, EditMode policy tests),
    scripts/WebRuntime/
    (bridge, error reporter,
    .jslib
    , AgentWeb template).
  • references/procedures.md
    :24 个 procedures 的完整代码(包括 bridge)、live test 和记录结果。
  • references/expert-notes.md
    :带时间戳的专家判断、完整数值和分歧表。
  • references/critique.md
    :self-review rubric。
  • references/gui-paths.md
    :通过 Windows 和菜单执行相同工作的说明。
  • references/sources.md
    :全部来源、凭据、时间戳和修订历史。
  • scripts/ut_web.py
    、
    scripts/AgentKit/Web/WebJobs.cs
    、
    scripts/AgentKitOptional/
    (Addressables job、EditMode policy tests)、
    scripts/WebRuntime/
    (bridge、error reporter、
    .jslib
    、AgentWeb template)。