Command Palette

Search for a command to run...

UnylyUnyly
Назад к скиллам

scenario-unity-web

БесплатноЗапускает вложенные скриптыНе проверен

Use when a Unity 6.3 game must run in a browser: 'export to WebGL', Web build settings or Build Profiles, gzip or Brotli, Decompression Fallback, server…

scenario-labsот scenario-labs★ 4 422 звезды на GitHub

Об этом скилле

Unity Web (web specialist)

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, load it with skill_get (Scenario MCP) or ask the user to install it (https://github.com/scenario-labs/skills#install); 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).

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.

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 crowd

Полный SKILL.md на GitHub

Установить scenario-unity-web в Claude Code и Claude Desktop

Зарегайся, чтобы установить скилл

Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.

  • Открой команду установки в одну строку
  • Сохраняй скиллы в синхронизируемую библиотеку
  • Уведомления, когда скиллы обновляются
Зарегаться бесплатноУ меня уже есть аккаунт

Разрешённые инструменты

Инструменты, которые скиллу разрешено вызывать.

Без ограничений — скилл может использовать любой инструмент.

Вложенные файлы

references/critique.mdreferences/expert-notes.mdreferences/gui-paths.mdreferences/procedures.mdreferences/sources.mdscripts/AgentKit/Web/WebJobs.csscripts/AgentKitOptional/Addressables/WebAddressablesJobs.csscripts/WebRuntime/Optional/Addressables/WebDeferredAddressable.csscripts/WebRuntime/Plugins/WebGL/AgentWebBridge.jslibscripts/WebRuntime/Scripts/WebBridge.csscripts/WebRuntime/Scripts/WebErrorReporter.csscripts/WebRuntime/Scripts/WebLeaderboard.csscripts/WebRuntime/WebGLTemplates/AgentWeb/index.htmlscripts/WebRuntime/WebGLTemplates/AgentWeb/thumbnail.pngscripts/ut_web.py

FAQ

Что делает скилл scenario-unity-web?

Use when a Unity 6.3 game must run in a browser: 'export to WebGL', Web build settings or Build Profiles, gzip or Brotli, Decompression Fallback, server headers, 'Unable to parse .framework.js.br', build too big or slow to load, itch.io, CrazyGames or Poki limits, Addressables or AssetBundles on the Web, 'Could not produce class with ID', Task.Run freezing the browser, WebGL 2 vs WebGPU, .jslib and SendMessage interop, a page text field that gets no keystrokes, mobile browsers crashing, HTTPS for sensors, hosting and rollout.

Как установить скилл scenario-unity-web?

Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.

Скилл scenario-unity-web запускает скрипты?

Да, скилл несёт исполняемые скрипты. Проверь исходник перед установкой.

Похожие скиллы

Сравнить scenario-unity-web с