using System.Collections;
using System.Collections.Generic;
using UnityEngine;public class KeyTest : MonoBehaviour
{// Start is called before the first frame updatevoid Start(){}// Update is called once per framevoid Update(){//鼠标的点击//按下鼠标 0左键 1右键 2滚轮if (Input.GetMouseButtonDown(0)){Debug.Log("按下了鼠标左键");}//持续的按下鼠标做左键if(Input.GetMouseButton(0)){Debug.Log("持续的按下鼠标左键");}//抬起鼠标if(Input.GetMouseButtonUp(0)){Debug.Log("抬起鼠标左键");}//传入参数可以为自带枚举或小写字符(注:大写字符不行)//按下键盘按键if(Input.GetKeyDown(KeyCode.A)){Debug.Log("按下了" + KeyCode.A + "键");}//持续按下键盘按键if(Input.GetKey("a")){Debug.Log("持续按下了" + KeyCode.A + "键");}//抬起键盘按键if(Input.GetKeyUp(KeyCode.A)){Debug.Log("抬起了" + KeyCode.A + "键");}}}