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

A singleton class to create spatialized audio sources. More...

Inheritance diagram for SoundSourceFactory:

Public Types

enum class  SpatMode {
  none , native , vasSimple , vasRaytracing ,
  resonanceAudio , oculusVR , steamVR
}
 [Deprecated] Which spatial rendering plugin to use. Only Google Resonance is supported right now. More...
 

Public Member Functions

GameObject Create (string fileName)
 Create a spatialized AudioSource. More...
 
GameObject Create (string fileName, SpatMode mode)
 
int getNumSources ()
 

Public Attributes

int maxNumSources = 10
 The maximum number of spatialized sources that can simultaneously be active. More...
 
float DefaultStartDistance = 500f
 The default start distance of a created source relative to the player. More...
 
float DefaultEndDistance = 500f
 The default end distance of a created source relative to the player. More...
 
SpatMode globalSpatMode = SpatMode.resonanceAudio
 

Static Public Attributes

static GameObject go = new GameObject()
 The GameObject that holds the AudioSource. More...
 
static SoundSourceFactory instance = go.AddComponent<SoundSourceFactory>()
 The singleton instance SoundSourceFactory. More...
 

Detailed Description

A singleton class to create spatialized audio sources.

Member Enumeration Documentation

◆ SpatMode

[Deprecated] Which spatial rendering plugin to use. Only Google Resonance is supported right now.

Member Function Documentation

◆ Create()

GameObject SoundSourceFactory.Create ( string  fileName)

Create a spatialized AudioSource.

Parameters
fileNameThe path of the audio file relative to Unity's Resources folder, without file extension.
Returns
A GameObject with the attached AudioSource.

◆ getNumSources()

int SoundSourceFactory.getNumSources ( )

Returns
The number of sources that are currently active.

Member Data Documentation

◆ DefaultEndDistance

float SoundSourceFactory.DefaultEndDistance = 500f

The default end distance of a created source relative to the player.

◆ DefaultStartDistance

float SoundSourceFactory.DefaultStartDistance = 500f

The default start distance of a created source relative to the player.

◆ go

GameObject SoundSourceFactory.go = new GameObject()
static

The GameObject that holds the AudioSource.

◆ instance

SoundSourceFactory SoundSourceFactory.instance = go.AddComponent<SoundSourceFactory>()
static

The singleton instance SoundSourceFactory.

◆ maxNumSources

int SoundSourceFactory.maxNumSources = 10

The maximum number of spatialized sources that can simultaneously be active.


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