Esempio n. 1
0
        public void PlayFromSrc(AudioCue cue, AudioSource src)
        {
            if (src == null)
            {
                Play(cue);
            }

            cue.PlayClipToSource(src);
        }
Esempio n. 2
0
        public void PlayAudio(AudioCue cue, AudioPlayType type, int priority)   //played from generic sources on cam
        {
            var item = CreateNewVoiceItemFromCue(cue, type, priority);

            item.source = GetAudioSourceForTrack(cue.GetTrack());       //equivalent for source-supplied sounds is to find mixer group and assign source to it

            AttemptAddSoundToList(item);
            ReviewSoundList();
        }
Esempio n. 3
0
        //public void StopSoundtrack()
        //{
        //    soundtrackSource.Stop();
        //}
        #endregion

        #region NEW play audio generic method with different overloads
        public void PlayAudio(AudioCue cue, AudioPlayType type, int priority, AudioSource source)   //played from the supplied source
        {
            var item = CreateNewVoiceItemFromCue(cue, type, priority);

            item.source = source;

            AttemptAddSoundToList(item);
            ReviewSoundList();
        }
Esempio n. 4
0
        private VoiceItem CreateNewVoiceItemFromCue(AudioCue cue, AudioPlayType type, int priority)
        {
            priority = Mathf.Clamp(priority, highestPriority, lowestPriority);

            var newClip = cue.SelectClip();

            VoiceItem item = new VoiceItem
            {
                clip      = newClip,
                track     = cue.GetTrack(),
                source    = null,   //to be assigned
                loop      = IsLooping(type),
                length    = newClip.length,
                timeEnds  = Time.time + newClip.length,
                priority  = priority,
                isPlaying = false,
                isGarbage = false
            };

            return(item);
        }
Esempio n. 5
0
 public void Play(AudioCue cue)
 {
     cue.PlayOneShotToSource(m_channels[cue.GetTrack()].audioSource);
 }
Esempio n. 6
0
 public AudioRequest(AudioCue cue, AudioSource src)
 {
     m_cue = cue;
     m_src = src;
 }
Esempio n. 7
0
 public void PlayFromSrc(AudioCue cue, AudioSource src)
 {
     m_audioAsset.PlayFromSrc(cue, src);
 }
Esempio n. 8
0
 public void Play(AudioCue cue)
 {
     m_audioAsset.Play(cue);
 }