Skip to content

Commit

Permalink
Resume background audio for level 4 end area ducking
Browse files Browse the repository at this point in the history
  • Loading branch information
tyson-kubota committed Nov 18, 2017
1 parent 44144e8 commit 73e19f1
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion AudioDuckingRegion.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,9 @@ function OnTriggerExit (other : Collider) {
}

function lerpDuck (timer : float, endVal : float) {

if (!StopAudioOnComplete && !audioSource.isPlaying) {audioSource.UnPause();}

var start = audioSource.volume;
var end = endVal;
var i = 0.0;
Expand All @@ -39,5 +42,5 @@ function lerpDuck (timer : float, endVal : float) {
}
yield WaitForSeconds (timer);

if (StopAudioOnComplete) {audioSource.Stop();}
if (StopAudioOnComplete) {audioSource.Pause();}
}

0 comments on commit 73e19f1

Please sign in to comment.