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

            cue.PlayClipToSource(src);
        }
Exemplo 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();
        }
Exemplo 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();
        }
Exemplo 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);
        }
Exemplo n.º 5
0
 public void Play(AudioCue cue)
 {
     cue.PlayOneShotToSource(m_channels[cue.GetTrack()].audioSource);
 }
Exemplo n.º 6
0
 public AudioRequest(AudioCue cue, AudioSource src)
 {
     m_cue = cue;
     m_src = src;
 }
Exemplo n.º 7
0
 public void PlayFromSrc(AudioCue cue, AudioSource src)
 {
     m_audioAsset.PlayFromSrc(cue, src);
 }
Exemplo n.º 8
0
 public void Play(AudioCue cue)
 {
     m_audioAsset.Play(cue);
 }