public int setParameters(AudioSource targetaudioSource, Gaze_AudioPlayList audioClips, Gaze_Actions.LOOP_MODES[] loop, Gaze_Actions.AUDIO_SEQUENCE[] sequence, bool[] fadeInBetween, float volumeMin, float volumeMax, bool duckingEnabled, float fadeSpeed, float fadeInTime, float fadeOutTime, bool fadeInEnabled, bool fadeOutEnabled, AnimationCurve fadeInCurve, AnimationCurve fadeOutCurve, bool[] activeTriggerStatesAudio, bool forceStop, bool allowMultiple, int maxConcurrentSound, bool randomizePitch, float minPitch, float maxPitch, bool[] loopOnLast, bool stopOthers) { audioSource = gameObject.GetComponent <AudioSource>(); audios.Add(new Gaze_AudioSource(audioSource)); audiosActions.Add(new Gaze_AudioAction(targetaudioSource, audioClips, loop, sequence, fadeInBetween, volumeMin, volumeMax, duckingEnabled, fadeSpeed, fadeInTime, fadeOutTime, fadeInEnabled, fadeOutEnabled, fadeInCurve, fadeOutCurve, activeTriggerStatesAudio, forceStop, allowMultiple, randomizePitch, minPitch, maxPitch, maxConcurrentSound, loopOnLast, stopOthers)); int key = audiosActions.Count - 1; audios.Add(new Gaze_AudioSource(audiosActions[key].audioSource)); return(key); }
public Gaze_AudioAction(AudioSource targetaudioSource, Gaze_AudioPlayList audioClips, Gaze_Actions.LOOP_MODES[] loop, Gaze_Actions.AUDIO_SEQUENCE[] sequence, bool[] fadeInBetween, float volumeMin, float volumeMax, bool duckingEnabled, float fadeSpeed, float fadeInTime, float fadeOutTime, bool fadeInEnabled, bool fadeOutEnabled, AnimationCurve fadeInCurve, AnimationCurve fadeOutCurve, bool[] activeTriggerStatesAudio, bool forceStop, bool allowMultiple, bool randomizePitch, float minPitch, float maxPitch, int max_audios, bool[] loopOnLast, bool stopOthers) { this.audioSource = targetaudioSource; clips = audioClips; this.volumeMax = (volumeMax); this.volumeMin = (volumeMin); this.MAX_AUDIOS = max_audios; this.stopOthers = stopOthers; for (int i = 0; i < activeTriggerStatesAudio.Length; i++) { if (activeTriggerStatesAudio[i]) { this.loopAudio[i] = loop[i]; this.sequence[i] = sequence[i]; this.fadeInBetween[i] = fadeInBetween[i]; this.loopOnLast[i] = loopOnLast[i]; this.lastClipIndex[i] = -1; } } this.forceStop |= forceStop; this.allowMultiple |= allowMultiple; if (duckingEnabled) { this.ducking = true; } if (fadeInEnabled) { this.fadeInEnabled = true; this.fadeInCurve = fadeInCurve; } if (fadeOutEnabled) { this.fadeOutEnabled = true; this.fadeOutTime = fadeOutTime; this.fadeOutCurve = fadeOutCurve; } if (randomizePitch) { this.randomizePitch = true; this.minPitch = minPitch; this.maxPitch = maxPitch; } }