Example #1
0
 // Fade the music volume over time.
 public void Fade(float time)
 {
     if (musicSource == null)
     {
         return;                      // Skip if there is no music source.
     }
     // Animate the volume to 0, using the Step4 function. Basically goes in 5 distinct steps : (1, 0.75, 0.5, 0.25, 0)
     musicSource.AnimateVolume(0, time, EaseMode.Step4);
 }