c# - How to use the same input twice or more
问题描述
Heres My Code
void Update()
{
if (Input.GetKeyDown(KeyCode.Space))
{
ContinueDialog();
Cursor.lockState = CursorLockMode.Locked;
}
}
I wanna use the space input twice or more to access my other function is there a way?
解决方案
您可以在代码的其他地方使用相同的功能。Input.GetKeyDown() 函数为按下键的第一帧返回 true,如下所示: https ://docs.unity3d.com/ScriptReference/Input.GetKeyDown.html
推荐阅读
- r - Specifying axis line thickness with magicaxis
- javascript - 嵌入式系统上的单页应用程序
- python - Passwordless Python LDAP3 authentication from Windows client
- c++ - Eigen equivalent of Matlab's sum(A)?
- javascript - 离子从系统中读取文件并将其放入画布中
- html - 如何通过get提交数组
- xml - 如何让 Import-Clixml 读取自定义凭据 XML 文件?
- c# - 如何在通用方法中的 HttpRequestHeaders 和 WebHeaderCollection 中添加标头?
- mysql - 使用连接和排序时的 Laravel 数据库排序问题
- intellij-idea - Intellij 在“解决冲突”窗口中撤消更改