Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //Part of the script
- /// <summary>
- /// Loop for lowering the volume
- /// </summary>
- private IEnumerator UpdateRoutine()
- {
- while (true)
- {
- UpdateVolume();
- yield return new WaitForSeconds(_targetTime);
- }
- }
- /// <summary>
- /// Lower the volume
- /// </summary>
- private void UpdateVolume()
- {
- AudioListener.volume = Mathf.Clamp01(AudioListener.volume + _currentDelta);
- }
Add Comment
Please, Sign In to add comment