예제 #1
0
        public IMyAudioEffect ApplyEffect(IMySourceVoice input, MyStringId effect, MyStringId[] cues = null, float?duration = null)
        {
            if (m_effectBank == null)
            {
                return(null);
            }
            List <MySourceVoice> voices = new List <MySourceVoice>();

            if (cues != null)
            {
                foreach (var cue in cues)
                {
                    voices.Add(GetSound(cue));
                }
            }
            return(m_effectBank.CreateEffect(input, effect, voices.ToArray(), duration));
        }
예제 #2
0
        public IMyAudioEffect ApplyEffect(IMySourceVoice input, MyStringHash effect, MyCueId[] cueIds = null, float?duration = null)
        {
            if (m_effectBank == null)
            {
                return(null);
            }
            int waveNumber;
            List <MySourceVoice> voices = new List <MySourceVoice>();

            if (cueIds != null)
            {
                foreach (var cueId in cueIds)
                {
                    voices.Add(GetSound(cueId, out waveNumber));
                }
            }
            return(m_effectBank.CreateEffect(input, effect, voices.ToArray(), duration));
        }
예제 #3
0
        public IMyAudioEffect ApplyEffect(IMySourceVoice input, MyStringHash effect, MyCueId[] cueIds = null, float?duration = null)
        {
            if (m_effectBank == null)
            {
                return(null);
            }
            int waveNumber;
            List <MySourceVoice> voices = new List <MySourceVoice>();

            if (cueIds != null)
            {
                foreach (var cueId in cueIds)
                {
                    var sound = GetSound(cueId, out waveNumber);
                    System.Diagnostics.Debug.Assert(sound != null, "Missing sound " + cueId);
                    if (sound != null)
                    {
                        voices.Add(sound);
                    }
                }
            }
            return(m_effectBank.CreateEffect(input, effect, voices.ToArray(), duration));
        }