@@ -12,6 +12,11 @@ public class Countdown : MonoBehaviour {
1212 public float counterTime = 1f ;
1313 public string [ ] kickOffPhrases ;
1414
15+ public AudioClip [ ] announcerCountdown ; // Must be 3 clips
16+
17+ public AudioClip [ ] announcerPhrases ;
18+ public AudioSource announcerAudioSource ;
19+
1520 void Start ( ) {
1621 StartCoroutine ( StartReplayScene ( ) ) ;
1722 }
@@ -20,17 +25,26 @@ IEnumerator StartReplayScene() {
2025 yield return new WaitForSeconds ( startDelay ) ;
2126 countdownText . fontSize = 40 ;
2227 countdownText . text = "3" ;
28+ announcerAudioSource . clip = announcerCountdown [ 2 ] ;
29+ announcerAudioSource . Play ( ) ;
2330 yield return new WaitForSeconds ( counterTime ) ;
2431 countdownText . fontSize = 60 ;
2532 countdownText . text = "2" ;
33+ announcerAudioSource . clip = announcerCountdown [ 1 ] ;
34+ announcerAudioSource . Play ( ) ;
2635 yield return new WaitForSeconds ( counterTime ) ;
2736 countdownText . fontSize = 80 ;
2837 countdownText . text = "1" ;
38+ announcerAudioSource . clip = announcerCountdown [ 0 ] ;
39+ announcerAudioSource . Play ( ) ;
2940 yield return new WaitForSeconds ( counterTime ) ;
3041 countdownText . fontSize = 100 ;
3142
3243 int i = Random . Range ( 0 , kickOffPhrases . Length ) ;
3344
45+ announcerAudioSource . clip = announcerPhrases [ i ] ;
46+ announcerAudioSource . Play ( ) ;
47+
3448 countdownText . text = kickOffPhrases [ i ] ;
3549 yield return new WaitForSeconds ( counterTime ) ;
3650 SceneManager . LoadScene ( destinationScene , LoadSceneMode . Single ) ;
0 commit comments