public AudioClip audioSuccess;
public AudioClip audioFail;
// Start is called before the first frame update
void Start()
{
}
// Update is called once per frame
void Update()
{
if (Input.GetKeyDown(KeyCode.M))
{
AudioSource audioSource = GetComponent<AudioSource>();
audioSource.PlayOneShot(audioSuccess);
}
else if (Input.GetKeyDown(KeyCode.N))
{
AudioSource audioSource = GetComponent<AudioSource>();
audioSource.PlayOneShot(audioFail);
}
}
**粗体** _斜体_ [链接](http://example.com) `代码` - 列表 > 引用
。你还可以使用@
来通知其他用户。