Add files via upload

This commit is contained in:
Geri 2021-01-08 18:01:14 +01:00 committed by GitHub
parent 310f5c8838
commit 7046716893
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 31 additions and 5 deletions

View file

@ -73,6 +73,19 @@ public class AudioManager : MonoBehaviour{
s.source.volume = s.RandomVolume;
s.source.PlayOneShot(s.clip);
}
public void PlayWithIntro(string intro, string song){
Sounds.List s = Array.Find(soundList.sounds, sound => sound.name == intro);
if (s == null){
Debug.LogWarning("Sound: " + intro + " not found!");
return;
}
s.source.pitch = s.RandomPitch;
s.source.volume = s.RandomVolume;
s.source.Play();
float introDuration = s.clip.length;
Play(song, introDuration);
}
#endregion
#region Pause
public void Pause(string name){