private void Update() { bool surfaceChange = false; if (Input.GetKeyDown(KeyCode.D)) { surface += 1; if (surface > 2) { surface = 0; } surfaceChange = true; } else if (Input.GetKeyDown(KeyCode.A)) { surface -= 1; if (surface < 0) { surface = 2; } surfaceChange = true; } //Assigns a different Audio Object to the Runtime Identifier "surfaceSound" when surface changes if (surfaceChange) { switch (surface) { case 1: MultiAudioManager.AssignRuntimeIdentifierAudioObject(surfaceSoundIdentifier, metalSfx); break; case 2: MultiAudioManager.AssignRuntimeIdentifierAudioObject(surfaceSoundIdentifier, waterSfx); break; default: MultiAudioManager.AssignRuntimeIdentifierAudioObject(surfaceSoundIdentifier, concreteSfx); break; } surfaceChange = false; } }