开发Unity3D移动端输入插件 UGUI Touch Inp
2020-03-05 本文已影响0人
SwordMaster
UGUI Touch Input Component
为了在移动设备上操控角色,本人便开发了UGUI Touch Input Component输入类插件.

特点
-
本插件中总共包含三种组件:the virtual joystick , the dynamic joystick and the virtual button.
-
所有的这些UGUI输入组件都是为移动平台所设计。在Unity Editor下,您也可以用鼠标的拖拽来测试这些组件..
-
创建这些输入组件,就像创建其它UGUI组件一样容易.
-
创建好输入组件后,有两种方式可以使用它们:
1.一种方式是,在Unity Editor下,将您想要调用的函数在这些输入组件的Inspector面板上的UnityEvent进行注册。
2.另一种方式是,你可以在代码中通过插件提供的API函数返回这些组件的输入值。
包含的输入组件

Demo场景
本插件共包含三个Demo场景:

(1).在Adam场景中,您可以通过virtual joystick来移动角色,通过virtual button让角色跳跃:



(2).在Car场景中,你可以通过屏幕上的dynamic joystick来驾驶汽车。dynamic joystick与virtual stick是有区别的,dynamic
joystick在屏幕上的位置是不固定的,它的位置会出现在您手指触摸的位置。


(3).在Player场景中,你可以通过位于左半屏幕的dynamic joystick来操控角色的移动,通过右半屏幕的dynamic joystick来操控角色
的射击方向。



所支持的Unity的版本
5.6.6 或 更高
下载地址
您可以从Unity Asset Store上进行下载:UGUI Touch Input Component