KeyCode

enumeration

切换到手册

描述

Event.keyCode 返回的键代码。这些代码直接映射到键盘上的物理键。

键代码可以用于通过 Input.GetKeyDownInput.GetKeyUp 检测键按下和键松开事件:

using UnityEngine;

public class KeyCodeExample : MonoBehaviour { void