Game Development Reference
In-Depth Information
RunSource.audio.clip = Run;
RunSource.audio.Play();
}
}
public void Spell()
{
audio.clip = Spell;
audio.Play();
}
public void Strike()
{
audio.clip = Strike;
audio.Play();
}
These functions will be the ones you will call to play a sound effect. To play the run
sound effect as a looping sound, we check to make sure that the sound has played
out before we play it again. This gives the illusion of a looping sound effect. To play
the rest of the sounds, we just assign the clip property and play it.
Search WWH ::




Custom Search