private IEnumerator TestAllSounds() { if (BlockedAudioSource == null) { BlockedAudioSource = GetComponent <AudioSource>(); BlockedAudioSource.maxDistance = MaxAudioDistance; } AudioClip tempClip; int clipNumber = 0; foreach (SoundEffects SoundEffect in Enum.GetValues(typeof(SoundEffects))) { Debug.Log("Attempting to load clip #" + clipNumber); tempClip = SoundEffectManager.GetClip(SoundEffect); if (tempClip != null) { Debug.Log("Playing clip #" + clipNumber); BlockedAudioSource.clip = tempClip; BlockedAudioSource.Play(); while (BlockedAudioSource.isPlaying) { yield return(null); } } clipNumber++; yield return(null); } }
public void ProcessSoundEffect(Assets.Scripts.SoundController.PlayMode Mode, SoundEffects SoundEffect) { AudioClip clip = SoundEffectManager.GetClip(SoundEffect); if (clip != null) { SoundControllerInstance instance = new SoundControllerInstance(Mode, clip); ProcessSoundEffect(instance); } }
public void RpcPlayDamageTakenSound() { AudioClip clip = new AudioClip(); clip = SoundEffectManager.GetClip(SoundEffects.Owww); if (Audio == null) { Audio = GetComponent <AudioSource>(); } Audio.PlayOneShot(clip); }
public void RpcPlayDeathSound() { AudioClip clip = new AudioClip(); switch (UnityEngine.Random.Range(0, 1)) { case 0: clip = SoundEffectManager.GetClip(SoundEffects.Ahhh); break; case 1: clip = SoundEffectManager.GetClip(SoundEffects.MyLeg); break; } if (Audio == null) { Audio = GetComponent <AudioSource>(); } Audio.PlayOneShot(clip); }
public SoundControllerInstance(PlayMode mode, SoundEffects SoundEffect) { Mode = mode; Clip = SoundEffectManager.GetClip(SoundEffect); }