예제 #1
0
        private void PrepareForReuse()
        {
            StopAllCoroutines();

            m_FadeInData  = null;
            m_FadeOutData = null;

            cachedGameObject.name = "AudioClipPlayer";

            ClipID   = null;
            Category = null;

            m_Source.clip = null;
            m_Source.outputAudioMixerGroup = null;
            if (m_Handle != null)
            {
                m_Handle.Clear();
            }
            m_Handle = null;

            foreach (var kv in m_Filters)
            {
                kv.Value.enabled = false;
            }

            cachedTransform.position = Vector3.zero;

            IsEmpty = true;
        }
예제 #2
0
        public void SetFilters(AudioManagerCategory cat)
        {
            if (cat.UseLowPassFilter)
            {
                AudioLowPassFilter filter = EnableFilter <AudioLowPassFilter>(EAudioFilter.LowPass);
                cat.AudioFilters.LowPass.SetToFilter(filter);
            }

            if (cat.UseHighPassFilter)
            {
                AudioHighPassFilter filter = EnableFilter <AudioHighPassFilter>(EAudioFilter.HighPass);
                cat.AudioFilters.HighPass.SetToFilter(filter);
            }

            if (cat.UseChorusFilter)
            {
                AudioChorusFilter filter = EnableFilter <AudioChorusFilter>(EAudioFilter.Chorus);
                cat.AudioFilters.Chorus.SetToFilter(filter);
            }

            if (cat.UseDistortionFilter)
            {
                AudioDistortionFilter filter = EnableFilter <AudioDistortionFilter>(EAudioFilter.Distortion);
                cat.AudioFilters.Distortion.SetToFilter(filter);
            }

            if (cat.UseEchoFilter)
            {
                AudioEchoFilter filter = EnableFilter <AudioEchoFilter>(EAudioFilter.Echo);
                cat.AudioFilters.Echo.SetToFilter(filter);
            }

            if (cat.UseReverbFilter)
            {
                AudioReverbFilter filter = EnableFilter <AudioReverbFilter>(EAudioFilter.Reverb);
                cat.AudioFilters.Reverb.SetToFilter(filter);
            }

            if (cat.UseFadeIn)
            {
                m_FadeInData = cat.AudioFilters.FadeIn;
            }

            if (cat.UseFadeOut)
            {
                m_FadeOutData = cat.AudioFilters.FadeOut;
            }
        }