My background music script is made to play one song then the other and so on infinitely but it gives me errors and doesn’t work.
Here is the script:
#pragma strict
var sandstorm1 : AudioClip;
var sandstorm2 : AudioClip;
function Start ()
{
PlaySandstorm();
}
function PlaySandstorm()
{
audio.PlayOneShot(sandstorm1, 0.3);
yield WaitForSeconds(210);
PlaySandstorm2();
}
function PlaySandstorm2()
{
audio.PlayOneShot(sandstorm2, 0.3);
yield WaitForSeconds(80);
PlaySandstorm();
}
My errors are:
Assets/Scripts/Music.js(22,9): BCE0070: Definition of ‘Music.PlaySandstorm2()’ depends on ‘Music.PlaySandstorm()’ whose type could not be resolved because of a cycle. Explicitly declare the type of either one to break the cycle.
Assets/Scripts/Music.js(22,9): BCE0070: Definition of ‘Music.PlaySandstorm2()’ depends on ‘Music.PlaySandstorm()’ whose type could not be resolved because of a cycle. Explicitly declare the type of either one to break the cycle.