Tier 3
Series 206
206G: The Sonic Exam
Capstone Exam
"The cockpit audio is a mess. The machine gun sounds like a robot, the warning alarm is drowning out the radio, and the collision sounds are causing the game to stutter. Identify the three critical audio failures."
Target Asset for Audit
FRAGILE_CODE_DETECTED
using UnityEngine;
using UnityEngine.Audio;
public class CockpitAudio : MonoBehaviour {
public AudioClip gunShot;
public AudioClip alarm;
public AudioSource radioSource;
void FireGun() {
// Audit Requirement: Lesson 206D (Randomizer)
// Error 1: Machine Gun Effect
GetComponent<AudioSource>().PlayOneShot(gunShot);
}
void PlayAlarm() {
// Audit Requirement: Lesson 206C (Ducking)
// Error 2: Volume Conflict
// The alarm plays at full volume, making the radio hard to hear.
// Logic tries to manually lower radio volume in a coroutine (not shown).
alarmSource.Play();
}
void OnBulletHit(Vector3 pos) {
// Audit Requirement: Lesson 206E (Pooling)
// Error 3: Garbage Generation
AudioSource.PlayClipAtPoint(hitClip, pos);
}
}