.claude/skills/audio-module/SKILL.md
AudioModule reference — SFX playback, music with crossfading, volume control with mixer integration. Use when working with audio, sound effects, music, or volume settings.
npx skillsauth add punkfuncgames/tetris-clone audio-moduleInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Package: com.punkfuncgames.audio | Define: PUNKFUNC_AUDIO
Location: Packages/com.punkfuncgames.audio/Runtime/PunkFuncGames.Audio/
Namespace: PunkFuncGames.Audio
PlaySFX(string id, float volumeScale = 1f)PlaySFXAtPosition(string id, Vector3 position, float volumeScale = 1f)ReadOnlyReactiveProperty<bool> IsMusicPlayingUniTask PlayMusicAsync(string id, float crossfadeDuration = 1f, bool loop = true, ct)UniTask StopMusicAsync(float fadeOutDuration = 1f, ct)PauseMusic(), ResumeMusic()ReadOnlyReactiveProperty<float> MasterVolume, MusicVolume, SFXVolumeSetVolume(AudioChannel channel, float volume) — clamped 0-1float GetVolume(AudioChannel channel)Master, Music, SFX, Voice, Ambient
Single service implements all 3 interfaces. Optional dependency: AudioSettings ScriptableObject.
[AudioService] root (DontDestroyOnLoad) with 2 music sources (A/B crossfade) + SFX poolMathf.Log10(volume) * 20f (0 → -80dB)Bridges MessagePipe events to AudioService:
PlaySFXRequest → PlaySFX/PlaySFXAtPositionPlayMusicRequest → PlayMusicAsyncGamePausedEvent → PauseMusicGameResumedEvent → ResumeMusicAudioSettings (ScriptableObject, "PunkFuncGames/Audio Settings"):
public AudioSettingsData data;_settings.data.fieldNameAudioSettingsData ([Serializable] public struct, camelCase fields):
mainMixer, masterVolumeParam, musicVolumeParam, sfxVolumeParamdefaultMasterVolume (1.0), defaultMusicVolume (0.7), defaultSFXVolume (1.0)sfxPoolSize, maxConcurrentSoundsList<SoundData> sounds, List<MusicData> musicSoundData ([Serializable] public struct): id, clip, volume, pitch, randomizePitch, pitchVariation, loop, spatialBlend
MusicData ([Serializable] public struct): id, clip, volume, bpm, loop
Extension methods provide any logic previously on the ScriptableObject.
| Event | Key Fields |
|-------|------------|
| PlaySFXRequest | SoundId, Volume, Position? |
| PlayMusicRequest | MusicId, CrossfadeDuration, Loop |
AudioInstaller.Install(builder, options, audioSettings);
// Registers: AudioService as EntryPoint (ISFXService, IMusicService, IVolumeService)
// Registers: AudioSettings via RegisterInstance (if non-null)
// Registers: AudioEventHandler as EntryPoint
// Events: PlaySFXRequest, PlayMusicRequest brokers
Third parameter AudioSettings settings = null is optional. When provided, the settings ScriptableObject is registered via RegisterInstance.
// Direct service call
_sfxService.PlaySFX("ButtonClick");
_sfxService.PlaySFXAtPosition("Explosion", transform.position);
await _musicService.PlayMusicAsync("BattleTheme", crossfadeDuration: 2f);
// Via MessagePipe (decoupled)
_sfxPublisher.Publish(new PlaySFXRequest("Coin", volume: 0.8f));
_musicPublisher.Publish(new PlayMusicRequest("MenuMusic", crossfadeDuration: 1.5f));
// Volume binding
_volumeService.MasterVolume
.Subscribe(vol => _masterSlider.value = vol)
.AddTo(_disposables);
development
WalletModule reference — currency management with BigDouble support, reactive properties, caps, lifetime stats, and persistence. Use when working with currencies, wallets, or financial systems.
development
UnlockConditionModule reference — composable unlock conditions using ScriptableObjects with AND/OR/NOT logic, stat/currency/upgrade/prestige/gamestate/boolean checks, reactive service layer with progress tracking. Use when implementing unlock systems, gating, or progression requirements.
development
UndoModule reference — command pattern with undo/redo stacks, command merging, and reactive state. Use when implementing undo/redo, undoable actions, or command patterns.
tools
Unity UI Toolkit reference — UXML documents, USS styling, MVVM pattern (ViewModel + Presenter), custom VisualElements, responsive layout, animations, performance guidelines, and complete Figma-to-UI-Toolkit property mapping. Use when building or modifying UI with UI Toolkit, creating UXML/USS files, writing ViewModels or Presenters, designing screens/panels/components, or converting Figma designs to UI Toolkit.