📜  unity 检测键盘而不是鼠标 - C# 代码示例

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

代码示例1
// Detect any keyboard input but not mouse input
private void Update()
{
    if (Input.anyKeyDown && !(Input.GetMouseButtonDown(0) 
        || !Input.GetMouseButtonDown(1) || !Input.GetMouseButtonDown(2)))
    {
        Debug.Log("No mouse pressed!");
    }
}