TO SQUASH: Lots of UI.
This commit is contained in:
@@ -10,12 +10,16 @@ public class MusicManager : MonoBehaviour
|
||||
|
||||
public AudioClip outro;
|
||||
|
||||
public AudioClip victory;
|
||||
|
||||
private AudioSource audioSource;
|
||||
|
||||
private Queue<AudioClip> clipsQueue;
|
||||
|
||||
private bool isPaused = false;
|
||||
|
||||
private bool needsReset = false;
|
||||
|
||||
// Start is called once before the first execution of Update after the MonoBehaviour is created
|
||||
void Start()
|
||||
{
|
||||
@@ -51,15 +55,29 @@ public class MusicManager : MonoBehaviour
|
||||
clipsQueue.Enqueue(outro);
|
||||
}
|
||||
|
||||
public void pauseMusic()
|
||||
public void PauseMusic()
|
||||
{
|
||||
audioSource.Pause();
|
||||
isPaused = true;
|
||||
}
|
||||
|
||||
public void resumeMusic()
|
||||
public void ResumeMusic()
|
||||
{
|
||||
if (needsReset)
|
||||
{
|
||||
clipsQueue.Clear();
|
||||
ResetQueue();
|
||||
needsReset = false;
|
||||
}
|
||||
|
||||
audioSource.UnPause();
|
||||
isPaused = false;
|
||||
}
|
||||
|
||||
public void PlayVictoryMusic()
|
||||
{
|
||||
audioSource.Stop();
|
||||
audioSource.PlayOneShot(victory);
|
||||
needsReset = true;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user