Ejemplo n.º 1
0
        private aAudioSource _PlaySound(aAudioClip audioClip, float volume = 1f, float pitch = 0f, float pan = 0f)
        {
            aAudioSource aAudioSource = GetAudioSoruce();

            aAudioSource.PlayClip(audioClip, volume, pitch, pan);
            return(aAudioSource);
        }
Ejemplo n.º 2
0
        private aAudioSource _PlayLoop(aAudioClip audioClip, aAudioSource aAudioSource, float volume = 1f, float pitch = 0f, float pan = 0f)
        {
            if (aAudioSource == null || !aAudioSource.IsActive())
            {
                aAudioSource = GetAudioSoruce();
            }

            aAudioSource.PlayLoop(audioClip, volume, pitch, pan);

            return(aAudioSource);
        }
Ejemplo n.º 3
0
 public static aAudioSource PlayLoop(aAudioClip audioClip, aAudioSource aAudioSource, float volume = 1f, float pitch = 0f, float pan = 0f)
 {
     if (Instance != null)
     {
         return(Instance._PlayLoop(audioClip, aAudioSource, volume, pitch, pan));
     }
     else
     {
         Debug.LogError("No touch system pressent in scene!");
     }
     return(null);
 }
Ejemplo n.º 4
0
        public aAudioSource PlayClip(aAudioClip audioClip, float volume = 1f, float pitch = 0f, float pan = 0f)
        {
            _currentClipp    = audioClip;
            audioSource.clip = audioClip.audioClip;
            audioSource.loop = false;
            audioSource.Play();

            _playType = PlayType.Clip;
            _active   = true;

            audioSource.volume    = _currentVolume = _currentClipp.volume * volume;
            audioSource.pitch     = _currentClipp.pitch + pitch;
            audioSource.panStereo = _currentClipp.pan + pan;

            return(this);
        }
Ejemplo n.º 5
0
        public aAudioSource PlayLoop(aAudioClip audioClip, float volume = 1f, float pitch = 0f, float pan = 0f)
        {
            if (_playType != PlayType.Loop && !_active)
            {
                _currentClipp    = audioClip;
                audioSource.clip = audioClip.audioClip;
                audioSource.loop = true;
                audioSource.Play();
                audioSource.volume = audioClip.volume;
                _playType          = PlayType.Loop;
                _active            = true;
            }

            audioSource.volume    = _currentVolume = _currentClipp.volume * volume;
            audioSource.pitch     = _currentClipp.pitch + pitch;
            audioSource.panStereo = _currentClipp.pan + pan;

            _lastLoopTime = Time.time;

            return(this);
        }