Why in the world is Unity showing variables from a different script?
using UnityEngine;
public class AudioController : MonoBehaviour {
private AudioSource audio;
public AudioClip cubeSelectSound;
private void Start() {
audio = GetComponent<AudioSource>();
}
public void PlaySoundOnCubeSelection() {
if (!selectedCubes.Contains(gameObject)) {
float soundPitch;
switch (selectedCubes.Count) {
case 1:
soundPitch = 1f;
break;
case 2:
soundPitch = 1.02f;
break;
case 3:
soundPitch = 1.04f;
break;
case 4:
soundPitch = 1.06f;
break;
default:
soundPitch = 0;
break;
}
PlaySoundOnce(soundPitch);
}
}
private void PlaySoundOnce(float soundPitch = 1f) {
audio.pitch = soundPitch;
audio.PlayOneShot(cubeSelectSound, 1f);
}
}