unity 按键
- 作者: 2015舟哥万岁
- 来源: 51数据库
- 2020-09-27
你说的应该是按下鼠标左键和抬起鼠标左键后实现一些功能吧.
可以使用Input.GetMouseDown(0)和InputGetMouseUp(0)来获取当前的鼠标输入。
void ongui()
{
if(gui.button(new rect(0,0,50,50),"按钮"))
{
debug.log("按钮被按下了");
}
}
可以使用Input.GetMouseDown(0)和InputGetMouseUp(0)来获取当前的鼠标输入。
void ongui()
{
if(gui.button(new rect(0,0,50,50),"按钮"))
{
debug.log("按钮被按下了");
}
}
推荐阅读
