public KeyCode _key;
public Button _button;
void Awake()
{
_button = GetComponent<Button>();
_animator = GetComponent<Animator>();
}
void Update()
{
if (Input.GetKeyDown(_key))
{
//当按下Key,button按钮被点击
_button.onClick.Invoke();
}
}