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