Skip to main content

Audio System

A good UI feels "crunchy" and responsive. Audio is 50% of that feel. HookUI includes a singleton manager and components to make UI audio effortless.

HookAudioManager

The core singleton. It persists across scene loads.

Features

  • Pitch Variation: Automatically plays sound with slight random pitch (0.95 - 1.05) to prevent "machine-gun" repetition fatigue.
  • Master Volume: Global slider to control UI volume.
  • Static Access: Call it from anywhere.
HookAudioManager.Play(myClip, 1.0f);

HookViewAudio Component

Attach this to any HookView to give it a voice without writing code.

Events

  • OnShow: Plays a clip when the view opens.
  • OnHide: Plays a clip when the view closes.

This integrates automatically with the HookView lifecycle events (OnShowStarted, OnHideStarted).

Best Practices

  • Use short, punchy sounds for UI (clicks, swooshes).
  • Use HookAudioManager.Instance.MasterVolume to wire up your Settings Menu volume slider.