Exemplo n.º 1
0
        /// <summary>
        /// Stop sound, first search key in mixed group, if found, handle sound and remove from mixed group and enqueue ready queue
        /// </summary>
        /// <param name="_name"></param>
        /// <param name="_during"></param>
        /// <param name="_delay"></param>
        public void StopSound(string _name, float _during = DAudio.NO_DURING, float _delay = DAudio.NO_DELAY)
        {
            // if in mixed group, handle audio in mixed group
            DAudio _dAudio = FindSoundInMixedGroup(_name);

            if (_dAudio == null)
            {
#if DINO_DEBUG
                DScreemLogger.Instance.LogToScreen("the name " + _name + "is not currently playing");
#endif
                return;
            }

            _dAudio.ExcuteOperation(DAudio.MIN_VOLUME, _during, _delay, false);
        }
Exemplo n.º 2
0
        /// <summary>
        /// Play sound, first search key in mixed group, if not found, dequeue from ready queue
        /// </summary>
        /// <param name="_name"></param>
        /// <param name="_volume"></param>
        /// <param name="_during"></param>
        /// <param name="_delay"></param>
        public void PlaySound(string _name, float _volume = DAudio.MAX_VOLUME, float _during = DAudio.NO_DURING, float _delay = DAudio.NO_DELAY)
        {
            // if in mixed group, handle audio in mixed group
            DAudio _dAudio = FindSoundInMixedGroup(_name);

            if (_dAudio == null)
            {
                _dAudio = _readyQueue.Dequeue();
            }

            if (_dAudio == null)
            {
#if DINO_DEBUG
                DScreemLogger.Instance.LogToScreen("there is no AudioSource Availible");
#endif
                return;
            }

            _dAudio.ExcuteOperation(_volume, _during, _delay);
        }