using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class C_3_8_1 : MonoBehaviour {
// Use this for initialization
void Start () {
}
// Update is called once per frame
void Update () {
// 按下键盘A键
if (Input.GetKeyDown(KeyCode.A)){
Debug.Log ("你按下了A");
}
// 按住键盘A键
if (Input.GetKey(KeyCode.A)) {
Debug.Log ("你按住了A");
}
// 抬起键盘A键
if (Input.GetKeyUp(KeyCode.A)) {
Debug.Log ("你抬起了A");
}
// 按下键盘左Shift键
if (Input.GetKeyDown(KeyCode.LeftShift)) {
Debug.Log ("你按下了左Shift");
}
// 按住键盘左Shift键
if (Input.GetKey(KeyCode.LeftShift)) {
Debug.Log ("你按住了左Shift");
}
// 按下键盘左Shift键
if (Input.GetKeyUp(KeyCode.LeftShift)) {
Debug.Log ("你抬起了左Shift");
}
// 按下鼠标左键
if (Input.GetMouseButtonDown(0)) {
Debug.Log ("你按下了鼠标左键");
}
// 按住鼠标左键
if (Input.GetMouseButton(0)) {
Debug.Log ("你按住了鼠标左键");
}
// 抬起鼠标左键
if (Input.GetMouseButtonUp(0)) {
Debug.Log ("你抬起了鼠标左键");
}
}
}
Unity键盘鼠标监听事件
最新推荐文章于 2024-05-11 08:30:00 发布