public void StopSound(Soundtypes aSoundType) { AudioSource TempAudioSource = m_AudioSources[(int)aSoundType]; if (TempAudioSource == null) { Debug.Log("Audio source: " + aSoundType + " is Null"); return; } TempAudioSource.Stop(); }
public void PlaySoundOneShot(AudioClips aAudioClip, Soundtypes aSoundType) { AudioSource TempAudioSource = m_AudioSources[(int)aSoundType]; if (TempAudioSource == null) { Debug.Log("Audio source: " + aSoundType + " is Null"); return; } TempAudioSource.loop = false; TempAudioSource.PlayOneShot(GetAudioClip(aAudioClip)); }
public void PlaySoundScheduled(AudioClips aAudioClip, double time, Soundtypes aSoundType) { AudioSource TempAudioSource = m_AudioSources[(int)aSoundType]; if (TempAudioSource == null) { Debug.Log("Audio source: " + aSoundType + " is Null"); return; } TempAudioSource.loop = false; TempAudioSource.clip = GetAudioClip(aAudioClip); TempAudioSource.PlayScheduled(time); }
public void PlaySoundDelayed(AudioClips aAudioClip, float delay, Soundtypes aSoundType) { AudioSource TempAudioSource = m_AudioSources[(int)aSoundType]; if (TempAudioSource == null) { Debug.Log("Audio source: " + aSoundType + " is Null"); return; } TempAudioSource.loop = false; TempAudioSource.clip = GetAudioClip(aAudioClip); TempAudioSource.PlayDelayed(delay); }
public void PlaySoundRepeating(AudioClips aAudioClip, Soundtypes aSoundType) { AudioSource TempAudioSource = m_AudioSources[(int)aSoundType]; if (TempAudioSource == null) { Debug.Log("Audio source: " + aSoundType + " is Null"); return; } TempAudioSource.loop = true; TempAudioSource.clip = GetAudioClip(aAudioClip); TempAudioSource.Play(); }
public void Play(Soundtypes st) { aus.pitch = Random.Range(0.8f, 1.25f); switch (st) { case Soundtypes.Paper: aus.PlayOneShot(paperSounds[Random.Range(0, paperSounds.Length)]); break; case Soundtypes.Ritch: aus.pitch = aus.pitch * 0.9f; aus.PlayOneShot(ritchSounds[Random.Range(0, ritchSounds.Length)]); break; case Soundtypes.Bump: aus.PlayOneShot(bumpSounds[Random.Range(0, bumpSounds.Length)]); break; } }