Ejemplo n.º 1
0
    void UpdateMuted()
    {
        for (int s = 0; s < allSources.Count; s++)
        {
            FXSource source = allSources[s];
            source.audioSource.mute = _isMuted;
        }

        for (int e = 0; e < extraAudioSources.Count; e++)
        {
            extraAudioSources[e].mute = _isMuted;
        }

        basicAudioSource.mute = _isMuted;
    }
Ejemplo n.º 2
0
    FXSource GetNextSource()
    {
        int sourceCount = allSources.Count;

        for(int s = 0;s<sourceCount;s++)
        {
            FXSource source = allSources[s];

            if(!source.audioSource.isPlaying)
            {
                return source;
            }
        }

        FXSource newSource = new FXSource();
        allSources.Add(newSource);
        newSource.audioSource = gameObject.AddComponent<AudioSource>();
        return newSource;
    }