Runner's High
Public Types | Public Member Functions | Public Attributes | List of all members
SoundSourceManager Class Reference

An object that can be attached to an AudioSource to control its spatial features. More...

Inheritance diagram for SoundSourceManager:

Public Types

enum class  ActionTemplate { Play , Stop , Destroy }
 The default playback mode of the attached source. More...
 
enum class  ConditionTemplate { Ended }
 

Public Member Functions

void AddUpdateRoutine (Func< bool > condition, ActionTemplate template, bool onlyOnce=true)
 Add a callback that should be invoked at a specific condition (for example, stop the sound source if its distance to the player is bigger than some value). More...
 
void AddUpdateRoutine (Func< bool > condition, Action action, bool onlyOnce=true)
 Add a callback that should be invoked at a specific condition (for example, stop the sound source if its distance to the player is bigger than some value). More...
 
bool RemoveUpdateRoutine (Func< bool > updateRoutine)
 Remove an update routine that was added previously. More...
 
void Move (UnityEngine.Vector3 force)
 Add a force to the source. More...
 

Public Attributes

float startDistance
 The default starting distance with respect to the player. More...
 
bool oneShot = true
 Toggle between oneshot or loop. More...
 
float moveSpeed = 0
 The movement speed of the source relative to the player. More...
 

Detailed Description

An object that can be attached to an AudioSource to control its spatial features.

Member Enumeration Documentation

◆ ActionTemplate

The default playback mode of the attached source.

Member Function Documentation

◆ AddUpdateRoutine() [1/2]

void SoundSourceManager.AddUpdateRoutine ( Func< bool >  condition,
Action  action,
bool  onlyOnce = true 
)

Add a callback that should be invoked at a specific condition (for example, stop the sound source if its distance to the player is bigger than some value).

Parameters
condition
action
onlyOnce

◆ AddUpdateRoutine() [2/2]

void SoundSourceManager.AddUpdateRoutine ( Func< bool >  condition,
ActionTemplate  template,
bool  onlyOnce = true 
)

Add a callback that should be invoked at a specific condition (for example, stop the sound source if its distance to the player is bigger than some value).

Parameters
condition
template
onlyOnce

◆ Move()

void SoundSourceManager.Move ( UnityEngine.Vector3  force)

Add a force to the source.

◆ RemoveUpdateRoutine()

bool SoundSourceManager.RemoveUpdateRoutine ( Func< bool >  updateRoutine)

Remove an update routine that was added previously.

Parameters
updateRoutine
Returns

Member Data Documentation

◆ moveSpeed

float SoundSourceManager.moveSpeed = 0

The movement speed of the source relative to the player.

◆ oneShot

bool SoundSourceManager.oneShot = true

Toggle between oneshot or loop.

◆ startDistance

float SoundSourceManager.startDistance

The default starting distance with respect to the player.


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