unity-build-audio
Build Unity runtime audio with mixer routing, spatial ownership, bounded voices, and interruption-safe playback.
- License 许可
- MIT
- 最近更新
- 2026-11-13
- Stars
- ★ 4
- Forks
- 3
01 前言 Front Matter
- name
- unity-build-audio
- engines
- [ "UNITY" ]
- description
- Build Unity runtime audio with mixer routing, spatial ownership, bounded voices, and interruption-safe playback.
02 资源文件 2
- 参考文档agents/openai.yaml260 B
- 参考文档references/audio-production.md3.8 KB
03 SKILL.md 正文
Unity Build Audio
When to use
Build Unity runtime audio with mixer routing, spatial ownership, bounded voices, and interruption-safe playback. Use this feature only for Unity-owned project code and assets.
Activation and prerequisites
Run commands/resolve-engine.sh and commands/resolve-skill.sh unity-build-audio before edits or tool launches. Continue only when the effective engine is UNITY and this skill is eligible. A requested skill never selects its engine. Honor the resolved task override evidence and permitted output scope when an isolated prototype is selected.
Identify Unity version, audio output targets, AudioMixer layout, imported clip settings, voice and memory budgets, pause policy, loudness targets and accessibility equivalents. Record any selected audio middleware separately.
Workflow
- Map gameplay events to AudioSource playback requests and explicit AudioMixer groups. Distinguish music, ambience, dialogue and transient effects; prevent direct sound calls from becoming authoritative gameplay transitions.
- Choose clip load type, compression, sample rate and preload behavior from duration, concurrency and target memory. Verify asset rights and language variants before runtime integration.
- Create a bounded voice manager with priority, stealing and coalescing rules. Track ownership and completion; pooled AudioSources must reset clip, pitch, spatial settings, mixer assignment and callbacks before reuse.
- Configure spatialBlend, attenuation, rolloff, doppler and listener ownership. Local split-screen or multiple listeners require a deliberate supported mixing strategy rather than accidentally activating duplicate listeners.
- Use AudioSettings.dspTime and scheduled playback when sample-aligned transitions are required. Explicitly bridge simulation, unscaled time and audio time; pause or slow motion must not corrupt music scheduling.
- Implement mixer snapshots, volume settings and ducking with reversible ownership. Scene teardown, focus changes and cancellation must stop or transfer owned loops without abruptly restoring another system's mix.
- Handle missing clips, output device changes and platform suspension without blocking gameplay. Supply subtitles, visual cues or alternative channels when sound communicates required information.
Read import, mixer and measurement decisions for load types, stereo/spatial choices, resource teardown and evidence limits.
Verification
- Test voice saturation, loops across scene changes, cancelled requests, pooled reuse and settings persistence.
- Listen on representative devices for clipping, spatial placement, transition seams, pause/resume and suspension recovery; inspect native mixer and audio profiler data.
- Record peak voices, DSP/CPU cost and memory against declared budgets. A successful AudioSource call is not a listening review.
Output
Clip import and mixer configuration, playback/voice ownership code, clock and cancellation contract, listening review and target audio measurements. Record environment, expected and observed results, evidence paths, and blocked or not-run checks separately from passes.
Boundaries
Do not install middleware or assume every audio backend behaves identically. Browser web-build audio activation and native audio suspension require separate testing. Engine guidance applies to engine-owned code; independent services retain their architecture contracts.
References
- Unity audio overview. Use the documentation matching the installed project version.
- Scheduled AudioSource playback. Use the documentation matching the installed project version.
04 同仓库更多 Skills
verify-web3-game-lifecycle
Verify a game's selected Web3 asset, wallet, ownership and trading lifecycle with contract properties, canonical recovery, actual target evidence and separate release readiness.
verify-onchain-game-assets
Verify exact on-chain game collection ownership and quantities at canonical blocks, reconcile inventory events, and design honest match admission. Use for ERC721/ERC1155 inventory, reorg recovery, reservations, or transfer-during-match rules.
plan-web3-game-assets
Define an opt-in Ethereum, Base or Immutable game-asset lifecycle, including token identity, supply, rights, custody, game eligibility and chain-specific dependencies.
integrate-game-wallets
Integrate explicit player-wallet connection, scoped SIWE authentication, authority invalidation and reviewed target-specific handoff without application-held player keys.
integrate-game-asset-trading
Integrate explicitly selected game asset settlement with exact unsigned intents, scoped approvals, idempotent operations and canonical receipt reconciliation. Use for NFT listing, buying, cancellation, retries or marketplace integration.
build-evm-game-contracts
Author and verify host-owned EVM game collections and explicit mint, burn, craft or admin rules with pinned Solidity tooling. Use for contract source and deployment candidates; deployment and player signing require separate authorization.