1. Obtain user input events:
1. Monitor keyboard keys
if (Input.GetKey(KeyCode.W)){
Debug.Log("用户按下了W");
}
2. Monitor mouse buttons
if (Input.GetMouseButton(0)){
//0为左键,1为右键
Debug.Log("用户按下了鼠标左键");
}
1. Monitor keyboard keys
if (Input.GetKey(KeyCode.W)){
Debug.Log("用户按下了W");
}
2. Monitor mouse buttons
if (Input.GetMouseButton(0)){
//0为左键,1为右键
Debug.Log("用户按下了鼠标左键");
}