Exemplo n.º 1
0
    public void StopSound(Soundtypes aSoundType)
    {
        AudioSource TempAudioSource = m_AudioSources[(int)aSoundType];

        if (TempAudioSource == null)
        {
            Debug.Log("Audio source: " + aSoundType + " is Null");
            return;
        }
        TempAudioSource.Stop();
    }
Exemplo n.º 2
0
    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));
    }
Exemplo n.º 3
0
    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);
    }
Exemplo n.º 4
0
    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);
    }
Exemplo n.º 5
0
    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();
    }
Exemplo n.º 6
0
    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;
        }
    }