Guest User

Untitled

a guest
Nov 19th, 2017
78
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.38 KB | None | 0 0
  1. //Part of the script
  2. /// <summary>
  3. /// Loop for lowering the volume
  4. /// </summary>
  5. private IEnumerator UpdateRoutine()
  6. {
  7. while (true)
  8. {
  9. UpdateVolume();
  10. yield return new WaitForSeconds(_targetTime);
  11. }
  12. }
  13.  
  14. /// <summary>
  15. /// Lower the volume
  16. /// </summary>
  17. private void UpdateVolume()
  18. {
  19. AudioListener.volume = Mathf.Clamp01(AudioListener.volume + _currentDelta);
  20. }
Add Comment
Please, Sign In to add comment