Skip to content

Component Reference

Quick-reference for every MonoBehaviour and ScriptableObject in HYDRA.


ScriptableObjects

AudioGroup

Assets → Create → OCEAN → HYDRA → AudioGroup

Central asset for a mixer group. Referenced by AudioTrack, AudioScatterer, AudioImpulse, and AudioManager.

MemberTypeDescription
typeAudioGroupTypeSFX, Dialogue, Music, or Ambience.
mixerAudioMixerGroupThe Unity mixer group this asset maps to.
volumeGroupboolEnable to allow HYDRA to fade this group's volume.
volumePropertyIdstringExposed mixer parameter name for volume (e.g. "MusicVolume").
pitchGroupboolEnable to allow pitch control.
pitchPropertyIdstringExposed mixer parameter name for pitch.
duckTargetsList<AudioDuckTarget>Groups this group ducks when it starts playing.
SetVolume(float)methodSet the mixer volume directly (dB).
OnVolumeChangeUnityEvent<float>Fired whenever the volume changes.

AudioTrack

Assets → Create → OCEAN → HYDRA → Audio Track

Defines a piece of music or ambience as a set of synchronized stems.

MemberTypeDescription
GroupAudioGroupMixer group for all stems.
BPMfloatTempo for beat-synced transitions.
LoopboolWhether all stems loop.
StemsList<AudioStem>The list of stem definitions.
ParametersList<AudioParameter>Named parameter mappings for vertical control.

Extension method: await track.Play() — plays via AudioManager.Instance.


AudioStem (serializable class)

MemberTypeDescription
idstringUnique stem identifier.
audioClipAudioClipDefault clip.
maximumVolumefloatVolume ceiling (0–1).
isActiveboolStarts audible if true.
multipleClipsboolRandom pool mode.
audioClipsList<AudioClip>Pool for random selection.
useWeightedClipsboolWeighted stochastic mode.
weightedClipsList<WeightedAudioClip>Weighted pool.
historySizeintSuppression window (0–8).

AudioParameter (serializable class)

MemberTypeDescription
namestringName used in SetParameter(name, value).
curvesList<StemParameterCurve>Per-stem response curves.

AudioEmotionalState

Assets → Create → OCEAN → HYDRA → Emotional State

Drives the stem mix from two independent 0–1 axes.

MemberTypeDescription
axisALabelstringDisplay name for axis A (cosmetic).
axisBLabelstringDisplay name for axis B (cosmetic).
stemMappingsList<EmotionalStemMapping>Per-stem axis response curves.

AudioSequence

Assets → Create → OCEAN → HYDRA → Audio Sequence

Ordered playlist of AudioTrack segments.

MemberTypeDescription
SegmentsList<AudioSequenceSegment>The segment list.

Transition

Assets → Create → OCEAN → HYDRA → Transition

Describes a single state-triggered track switch.

MemberTypeDescription
fromAudioTrackSource track.
toAudioTrackDestination track.
typeTriggerImmediate, OnBeat, OnDownBeat, OnBar.
durationfloatCrossfade time.
variablestringVariable name checked by SetInt.
stateintRequired variable value.
stingersList<AudioTrack>Optional one-shot stingers.

MonoBehaviours

AudioManager

Singleton. Central registry and controller. Implements IAudioManager.

MemberDescription
audioGroupsAll managed AudioGroup assets.
AudioTracksLive list of all registered AudioTrackPlayers.
RegisterAudioTrack(player)Called automatically by AudioTrackPlayer.Awake.
UnregisterAudioTrack(player)Called automatically by AudioTrackPlayer.OnDestroy.
CreateAudioTrack(track, parent, fade, playOnAwake)Instantiates and registers a new player.
GetAudioTrackPlayer(track)Returns the first registered player for a track.
PlayAudioTrack(track, duration)Async play via the manager.
StopAudioTrack(track, duration)Stop by track reference.
StopAudioTracksOfGroup(group, duration)Stop all players of a group.
IsPlaying(group)True if any player in the group is active.
Crossfade(track, duration)Stop the group, fade in the new track.
Crossfade(track, duration, timing)Beat-synced crossfade.
PushSnapshot()Save all group volumes to a stack.
PopSnapshot(fade)Restore the last saved snapshot.
SetAudioGroupVolume(type, volume)Set a group's volume (linear 0–1).
FadeAudioGroupVolume(type, to, duration)Fade a group's volume.
SimpleTransition(tracks, duration)Legacy: fade out current globals, fade in new tracks.

AudioTrackPlayer

Controls playback of a single AudioTrack. One AudioSource per stem.

MemberDescription
audioTrackThe AudioTrack asset being played.
emotionalStateOptional AudioEmotionalState asset.
IsPlayingTrue if any stem source is playing.
MetronomeThe internal Metronome for beat events.
StemsLive list of AudioStems.
AudioSourcesRead-only list of stem AudioSources.
OnStartedEvent fired when Play is called.
OnStoppedEvent fired when Stop is called.
OnTransitionClipEndEvent fired when a stinger clip finishes.
Play(fade)Play all active stems.
Play(id, fade)Fade in a single stem.
PlayLooped(fade)Force-loop all stems and play.
PlayOnce(fade)Force single-shot and play; returns CoRunner.
Stop(fade)Fade out and stop.
ForceStop()Stop immediately (no fade).
Mute(fade)Fade all stems to zero.
Mute(id, fade)Fade one stem to zero.
FadeVolume(id, target, fade)Fade one stem to a target volume.
SetVolume(volume)Set all stems' raw volume instantly.
SetVolume(id, volume)Set one stem's raw volume instantly.
SetParameter(name, value, fade)Drive a named parameter curve set.
PlayOnBeat(id, fade)Fade in a stem on the next beat.
StopOnBeat(id, fade)Fade out a stem on the next beat.
SoloStem(id, fade)Mute all stems except one.
ClearSolo(fade)Restore all stems to their isActive defaults.
SetEmotionalState(axisA, axisB, fade)Drive the mix from two emotional axes.
AddTransitionClip(transition)Play a stinger and fire OnTransitionClipEnd.
DestroyAll(duration)Fade out and destroy the entire GameObject.

AudioTracksManager

State-machine-style track switcher. Manages one "active track" and transitions between tracks via variables.

MemberDescription
audioTrackCurrently playing track.
transitionsList of Transition assets.
multipleTracksPre-instantiate all tracks at startup.
audioTracksFull track list (used only when multipleTracks is on).
SetInt(key, value)Update a variable and check for a matching transition.
TransitionTo(track, duration)Immediate crossfade.
TransitionTo(track, timing, duration)Beat-synced crossfade.
QueueTransition(transition)Enqueue a transition to fire after the current one.

AudioSequencePlayer

Plays an AudioSequence segment by segment.

MemberDescription
sequenceThe AudioSequence asset.
IsPlayingTrue if a segment is currently active.
CurrentSegmentIndexIndex of the current segment, or -1.
CurrentPlayerThe AudioTrackPlayer for the current segment.
OnSegmentChangedUnityEvent<int> — fires on each segment change.
Play()Start from segment 0.
Stop(fade)Stop and clean up.
Skip(fade)Advance to the next segment.
JumpTo(index, fade)Jump to a specific segment.

AudioBlendZone

Crossfades two tracks based on listener position inside a trigger collider.

FieldDescription
trackATrack at blend = 0.
trackBTrack at blend = 1.
blendAxisLocal-space blend direction.
listenerTransform to track.
entryFadeDurationFade-in on trigger enter.

AudioAcousticZone

Swaps AudioMixerSnapshot on trigger enter/exit.

FieldDescription
insideSnapshotSnapshot applied on enter.
outsideSnapshotSnapshot restored on exit.
enterTransitionTimeBlend time on enter.
exitTransitionTimeBlend time on exit.
listenerTransform to track.

AudioOcclusionController

Real-time raycast-based low-pass filter occlusion. Requires AudioTrackPlayer on the same GameObject.

FieldDescription
listenerListener transform.
occlusionLayersGeometry layers that block audio.
maxHitsMax wall hits per ray.
updateIntervalSeconds between raycasts.
occludedCutoffHzLow-pass cutoff when fully occluded.
occludedResonanceQFilter resonance when fully occluded.
smoothTimeBlend speed between states.

AudioDistanceControl

Per-stem volume falloff by distance between a target and the player.

FieldDescription
targetSound source position.
playerListener position.
audioTrackThe AudioTrackPlayer to control.
stemDistancesList of StemVolumeDistance entries (stem ID, max/no-volume distances).

AudioScatterer

Randomly spawns ambient one-shot sounds around a listener.

FieldDescription
clipsClip pool.
listenerSpawn centre.
spawnRadiusSpawn area radius.
minSpawnDistanceMin gap between consecutive spawn positions.
eventsPerMinuteAverage spawn rate.
baseVolume / volumeVariationVolume and variation.
basePitch / pitchVariationPitch and variation.
audioGroupMixer routing.

AudioImpulse

Pooled one-shot sound with weighted clip selection and rate limiting.

FieldDescription
clipFallback single clip.
weightedClipsWeighted clip pool (overrides single clip).
historySizeRecent-play suppression window.
pitchRangeRandom pitch range per play.
volumeRangeRandom volume range per play.
minIntervalCooldown between plays in seconds.
audioGroupMixer routing.
poolSizePre-created source count.
Play()Fire a one-shot. Rate-limited.

AudioInitializer

Convenience component. Creates and starts a list of AudioTracks when the scene loads.

FieldDescription
audioTracksTracks to start at scene load.

VerticalAudioTransition

Fires stem play/mute commands on a BoxCollider trigger exit.

FieldDescription
trackPlayerTarget AudioTrackPlayer.
transitionsList of stem ID + Play/Stop + duration entries.

HYDRA — HYbrid Dynamically Responsive Audio · Part of the OCEAN framework.