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); }
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); }
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); }
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); }
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); }