unity箭头控制物体移动
·
在update中使用if进行判断
if(input.GetKey(KeyCode.LeftArrow))
{
//箭头左
//向左移动
//括号里写按下去一次需要向此方向移动多远
}
if(input.GetKey(KeyCode.RightArrow))
{
//箭头右
//向右移动
}
if(input.GetKey(KeyCode.UpArrow))
{
//箭头上
//向上移动
}
if(input.GetKey(KeyCode.DownArrow))
{
//箭头下
//向下移动
}
更多推荐



所有评论(0)