Tanks Multiplayer  1.5
Static Public Member Functions | Public Attributes | List of all members
AudioManager

Handles playback of background music, 2D and 3D one-shot clips during the game. Makes use of the PoolManager for activating 3D AudioSources at desired world positions. More...

Inheritance diagram for AudioManager:

Static Public Member Functions

static AudioManager GetInstance ()
 Returns a reference to this script instance. More...
 
static void PlayMusic (int index)
 Play sound clip in 2D on the background audio source. There can only be one music clip playing at the same time. Only plays music if the player enabled it in the settings. More...
 
static void Play2D (AudioClip clip)
 Play sound clip passed in in 2D space. More...
 
static void Play3D (AudioClip clip, Vector3 position, float pitch=0f)
 Play sound clip passed in in 3D space, with optional random pitch (0-1 range). Automatically creates an audio source for playback using our PoolManager. More...
 

Public Attributes

AudioSource musicSource
 AudioSource for playing back lengthy music clips. More...
 
AudioSource audioSource
 AudioSource for playing back one-shot 2D clips. More...
 
GameObject oneShotPrefab
 Prefab instantiated for playing back one-shot 3D clips. More...
 
AudioClip[] musicClips
 Array for storing background music clips, so they can be referenced in PlayMusic() by passing in their index value. More...
 

Detailed Description

Handles playback of background music, 2D and 3D one-shot clips during the game. Makes use of the PoolManager for activating 3D AudioSources at desired world positions.

Member Function Documentation

static AudioManager GetInstance ( )
static

Returns a reference to this script instance.

static void Play2D ( AudioClip  clip)
static

Play sound clip passed in in 2D space.

static void Play3D ( AudioClip  clip,
Vector3  position,
float  pitch = 0f 
)
static

Play sound clip passed in in 3D space, with optional random pitch (0-1 range). Automatically creates an audio source for playback using our PoolManager.

static void PlayMusic ( int  index)
static

Play sound clip in 2D on the background audio source. There can only be one music clip playing at the same time. Only plays music if the player enabled it in the settings.

Member Data Documentation

AudioSource audioSource

AudioSource for playing back one-shot 2D clips.

AudioClip [] musicClips

Array for storing background music clips, so they can be referenced in PlayMusic() by passing in their index value.

AudioSource musicSource

AudioSource for playing back lengthy music clips.

GameObject oneShotPrefab

Prefab instantiated for playing back one-shot 3D clips.


The documentation for this class was generated from the following file: