我只想将"~“按钮添加到InputManager中,这样我就可以像这样启用我的开发控制台:
public string toggle = "~";
void Update ()
{
if (toggle == string.Empty)
{
return;
}
if (Input.GetButtonDown (toggle))
{
consoleObject.SetActive( !consoleObject.activeSelf );
}
}你有什么建议吗?
发布于 2016-05-05 22:10:36
我相信在Mac计算机中,"~“字符与"`”字符共享密钥。我刚刚测试了一下,它起作用了。
if (true == Input. GetButtonDown ("`"))
{
Debug.Log ("worked");
}你所要做的就是找到你想要的平台的关键代码(Windows有一个与整数绑定的关键代码)。
谢谢。
https://stackoverflow.com/questions/37045703
复制相似问题