Unity Input 鼠标模拟

Unity iOS/Android 提供了鼠标模拟功能,允许开发者在移动平台上通过Input类使用鼠标操作。当手指触摸屏幕时,Input.anyKey或Input.anyKeyDown返回true,Input.mousePosition表示触摸点的屏幕坐标。每个触摸被视为"mouse 0",对应鼠标左键。此外,Input类的其他成员也可用于鼠标功能的模拟。在多指触摸时,mousePosition是所有触摸点的中心位置。
摘要由CSDN通过智能技术生成

Unity官方用户手册里有这么一段话:

Mouse Simulation

On top of native touch support Unity iOS/Android provides a mouse simulation. You can use mouse functionality from the standardInput class.

翻译为:

鼠标模拟

除了原有的触摸支持以外,Unity iOS/Android还提供了鼠标模拟。你可以通过标准的Input类来使用鼠标功能。

 

那么,Input类中有哪些鼠标功能呢?

查看Input类的成员可以找到

 

anyKey Is any key or mouse button currently held down? (Read Only)
anyKeyDown Returns true the first frame the user hits any key or mouse button. (Read Only)

 在iOS/Android中,手指按下(anykey)或一直触摸不松开(anykeydown)即可返回true

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值