public class sosjn : MonoBehaviour
{
private AudioSource AudioNotes;
[Header("Массив нот")]
[SerializeField] private AudioClip[] Notes = new AudioClip[4];
void Start()
{
AudioNotes = GetComponent<AudioSource>();
}
public void Update(int numberNotes)
{
if (Input.GetKeyDown(KeyCode.S))
{
AudioNotes.clip = Notes[numberNotes];
AudioNotes.Play();
}
}
}