Performance: Audio Source component
MEDIUM IMPACT
This affects how audio clips are loaded, played, and managed in the game, impacting frame rate and responsiveness.
AudioSource audioSource = GetComponent<AudioSource>(); foreach (var clip in clips) { audioSource.clip = clip; audioSource.Play(); }foreach (var clip in clips) { AudioSource.PlayClipAtPoint(clip, transform.position); }| Pattern | CPU Usage | Memory Allocation | Audio Latency | Verdict |
|---|---|---|---|---|
| Multiple PlayClipAtPoint calls | High | High | Variable | [X] Bad |
| Single AudioSource reuse | Low | Low | Stable | [OK] Good |