一、获取用户输入事件:
1、监听键盘按键
if (Input.GetKey(KeyCode.W)){
Debug.Log("用户按下了W");
}
2、监听鼠标按键
if (Input.GetMouseButton(0)){
//0为左键,1为右键
Debug.Log("用户按下了鼠标左键");
}
1、监听键盘按键
if (Input.GetKey(KeyCode.W)){
Debug.Log("用户按下了W");
}
2、监听鼠标按键
if (Input.GetMouseButton(0)){
//0为左键,1为右键
Debug.Log("用户按下了鼠标左键");
}