Class SoundyService.AudioPlayerPool
Specialized pool of audio players
Inherited Members
Namespace: Doozy.Runtime.Soundy
Assembly: cs.temp.dll.dll
Syntax
public class AudioPlayerPool
Properties
activePlayersCount
Number of audio players that are currently out of the pool and in use.
Declaration
public int activePlayersCount { get; }
Property Value
Type | Description |
---|---|
Int32 |
inPoolPlayersCount
Number of audio players that are currently in the pool and are not in use, thus ready to be used.
Declaration
public int inPoolPlayersCount { get; }
Property Value
Type | Description |
---|---|
Int32 |
isIdlePlayersCount
Number of audio players that are currently is use and idle (not playing a sound)
Declaration
public int isIdlePlayersCount { get; }
Property Value
Type | Description |
---|---|
Int32 |
isPausedPlayersCount
Number of audio players that are currently is use and paused (not playing a sound, but paused)
Declaration
public int isPausedPlayersCount { get; }
Property Value
Type | Description |
---|---|
Int32 |
isPlayingPlayersCount
Number of audio players that are currently is use and playing a sound
Declaration
public int isPlayingPlayersCount { get; }
Property Value
Type | Description |
---|---|
Int32 |
isStoppedPlayersCount
Number of audio players that are currently is use and stopped (not playing a sound, but stopped)
Declaration
public int isStoppedPlayersCount { get; }
Property Value
Type | Description |
---|---|
Int32 |
Methods
Dispose(AudioPlayer)
Dispose the specified player and remove it from the pool and active players list. This will destroy the game object of the player.
Declaration
public void Dispose(AudioPlayer player)
Parameters
Type | Name | Description |
---|---|---|
AudioPlayer | player | Player to dispose |
FadeOutAndStopAllActivePlayers()
Fade out and stop all active players
Declaration
public void FadeOutAndStopAllActivePlayers()
GetAudioPlayer()
Get an audio player from the pool. If there are no available audio players, a new one will be created.
Declaration
public AudioPlayer GetAudioPlayer()
Returns
Type | Description |
---|---|
AudioPlayer | An audio player from the pool |
Initialize(Transform)
Initializes the pool with the specified parent transform
Declaration
public void Initialize(Transform parent)
Parameters
Type | Name | Description |
---|---|---|
Transform | parent | Parent transform |
MuteAllActivePlayers()
Mute all active players
Declaration
public void MuteAllActivePlayers()
PauseAllActivePlayers()
Pause all active players
Declaration
public void PauseAllActivePlayers()
PreheatPool(Int32)
Preheats the pool with the specified number of audio players
Declaration
public void PreheatPool(int count)
Parameters
Type | Name | Description |
---|---|---|
Int32 | count | Number of audio players to preheat the pool with |
RecycleAll(Boolean)
Return all active audio players to the pool. This method also removes any null players from the pool's active players list.
Declaration
public void RecycleAll(bool ignoreRecycleAfterUse = false)
Parameters
Type | Name | Description |
---|---|---|
Boolean | ignoreRecycleAfterUse | If true, all players will be recycled, even if they have the recycleAfterUse flag set to false |
RecycleIdlePlayers()
Recycle all idle audio players that have the recycleAfterUse flag set to true and are not currently playing a sound.
Declaration
public void RecycleIdlePlayers()
RemoveIdlePlayers(Int32)
Remove all idle players from the pool and active players list, but keep the specified number of players alive.
Declaration
public void RemoveIdlePlayers(int minPlayersToKeepAlive)
Parameters
Type | Name | Description |
---|---|---|
Int32 | minPlayersToKeepAlive |
RemoveNullPlayers()
Remove all null players from the pool and active players list
Declaration
public void RemoveNullPlayers()
StopAllActivePlayers()
Stop all active players
Declaration
public void StopAllActivePlayers()
UnmuteAllActivePlayers()
Unmute all active players
Declaration
public void UnmuteAllActivePlayers()
UnPauseAllActivePlayers()
Unpause all active players
Declaration
public void UnPauseAllActivePlayers()