예제 #1
0
    public void StopAll()
    {
        m_looping = false;
        StopAllCoroutines();
        IDictionaryEnumerator enumerator = m_childComponents.GetEnumerator();

        try
        {
            while (enumerator.MoveNext())
            {
                DictionaryEntry dictionaryEntry = (DictionaryEntry)enumerator.Current;
                if (dictionaryEntry.Value is AudioComponent)
                {
                    AudioComponent audioComponent = dictionaryEntry.Value as AudioComponent;
                    audioComponent.StopAll();
                }
                if (dictionaryEntry.Value is AudioRandomComponent)
                {
                    AudioRandomComponent audioRandomComponent = dictionaryEntry.Value as AudioRandomComponent;
                    audioRandomComponent.StopAll();
                }
            }
        }
        finally
        {
            IDisposable disposable;
            if ((disposable = (enumerator as IDisposable)) != null)
            {
                disposable.Dispose();
            }
        }
    }