Skip to content

Commit

Permalink
Merge branch 'fragmental-YetAnotherMusicFix' into humble_release
Browse files Browse the repository at this point in the history
  • Loading branch information
Cheeseness committed May 3, 2017
2 parents a0d376f + 85d503a commit e004723
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion Assets/scripts/audio/MusicPlayer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ void Start()
RandomSong();
coroutine = PlayMusic();
StartCoroutine(coroutine);

}

void Update()
Expand All @@ -41,7 +42,8 @@ IEnumerator PlayMusic()
{
musicSource.clip = musicArray[currentSong];
musicSource.Play();
yield return new WaitForSeconds(musicSource.clip.length);
//This should really be instantiated at runtime and then accessed from an array for better garbage collection, but... - sjm
yield return new WaitForSecondsRealtime(musicSource.clip.length);
if (currentSong < musicArray.Length - 1)
{
currentSong++;
Expand Down

0 comments on commit e004723

Please sign in to comment.