Class MusicPlayer

Namespace
SurvivorsMaker.Presentation
Assembly
SurvivorsMaker.Presentation.dll

Context music with crossfades: menu, arena or field waves, shop / level-up and boss (while a boss is alive). The context follows a bound SurvivorsGame (Choose(bool, RunPhase, RunMode, bool, bool, bool)) unless Override is set. Volume = track × catalog music volume × the music option × ducking; the master option reaches it through the AudioListener. Runs on unscaled time so pausing does not freeze a fade.

public sealed class MusicPlayer : MonoBehaviour
Inheritance
Object
Component
Behaviour
MonoBehaviour
MusicPlayer
Inherited Members
MonoBehaviour.IsInvoking()
MonoBehaviour.CancelInvoke()
MonoBehaviour.StopCoroutine(Coroutine)
MonoBehaviour.StopAllCoroutines()
MonoBehaviour.destroyCancellationToken
MonoBehaviour.useGUILayout
MonoBehaviour.didStart
MonoBehaviour.didAwake
MonoBehaviour.runInEditMode
Behaviour.enabled
Behaviour.isActiveAndEnabled
Component.GetComponent<T>()
Component.TryGetComponent<T>(out T)
Component.GetComponentInChildren<T>()
Component.GetComponentsInChildren<T>()
Component.GetComponentInParent<T>()
Component.GetComponentsInParent<T>()
Component.GetComponents<T>()
Component.GetComponentIndex()
Component.CompareTag(TagHandle)
Component.transform
Component.transformHandle
Component.gameObject
Component.tag
Object.GetEntityId()
Object.GetInstanceID()
Object.GetHashCode()
Object.InstantiateAsync<T>(T)
Object.InstantiateAsync<T>(T, Transform)
Object.InstantiateAsync<T>(T, Vector3, Quaternion)
Object.InstantiateAsync<T>(T, Transform, Vector3, Quaternion)
Object.Instantiate(Object, Vector3, Quaternion)
Object.Instantiate(Object, Vector3, Quaternion, Transform)
Object.Instantiate(Object)
Object.Instantiate(Object, Scene)
Object.Instantiate<T>(T, InstantiateParameters)
Object.Instantiate<T>(T, Vector3, Quaternion, InstantiateParameters)
Object.Instantiate(Object, Transform)
Object.Instantiate<T>(T)
Object.Instantiate<T>(T, Vector3, Quaternion)
Object.Instantiate<T>(T, Vector3, Quaternion, Transform)
Object.Instantiate<T>(T, Transform)
Object.Destroy(Object)
Object.DestroyImmediate(Object)
Object.DontDestroyOnLoad(Object)
Object.DestroyObject(Object)
Object.FindObjectsOfType<T>()
Object.FindObjectsByType<T>(FindObjectsSortMode)
Object.FindObjectsByType<T>(FindObjectsInactive, FindObjectsSortMode)
Object.FindObjectOfType<T>()
Object.FindFirstObjectByType<T>()
Object.FindAnyObjectByType<T>()
Object.FindFirstObjectByType<T>(FindObjectsInactive)
Object.FindAnyObjectByType<T>(FindObjectsInactive)
Object.ToString()
Object.name
Object.hideFlags

Constructors

MusicPlayer()

public MusicPlayer()

Properties

Catalog

public SoundCatalogAsset Catalog { get; }

Property Value

SoundCatalogAsset

Context

The context asked for this frame (before falling back to a context that has a track).

public MusicContext Context { get; }

Property Value

MusicContext

CurrentClip

The track now fading in or playing, or null for silence.

public AudioClip CurrentClip { get; }

Property Value

AudioClip

DuckLevel

public float DuckLevel { get; }

Property Value

float

Override

public MusicContext Override { get; set; }

Property Value

MusicContext

Session

public SurvivorsGame Session { get; }

Property Value

SurvivorsGame

Methods

Bind(SurvivorsGame)

public void Bind(SurvivorsGame game)

Parameters

game SurvivorsGame

Configure(SoundCatalogAsset)

Changes the catalog. A playing track keeps playing when the new catalog uses the same clip.

public void Configure(SoundCatalogAsset value)

Parameters

value SoundCatalogAsset

Duck(float)

Keeps the music ducked for at least seconds (scaled by the catalog's hold scale).

public void Duck(float seconds)

Parameters

seconds float

StopNow()

Stops both voices at once; the next frame fades the context's track in again while the component is enabled.

public void StopNow()