📜  c# unity control key input - C# 代码示例

📅  最后修改于: 2022-03-11 14:48:56.850000             🧑  作者: Mango

代码示例1
[SerializeField] KeyCode your_key; //select a key in the inspector

void Update()
{
    if (Input.GetKey(your_key))
    {
        print("your selected key was pressed");
    }
}