|
FingerGestures最大的好处就是结合unity3d进行多点触控,手势识别,编写一次代码 ,通过配置来进行多平台发布FingerGestures提供了3种不同的方法来检测由用户执行的拖动手势。
- 每个手指的手势事件:为每个单独的手指,独立的状态
- OnFingerTap
- OnFingerDoubleTap
- OnFingerSwipe
- OnFingerLongPress
- OnFingerDragBegin,OnFingerDragMove,OnFingerDragEnd
- 全局手势事件:
- 当一个手指触摸屏幕上:
- OnTAP
- OnDoubleTap
- OnSwipe
- OnLongPress
- OnDragBegin,OnDragMove,OnDragEnd
- 两个手指触摸屏幕时:
- OnPinchBegin,OnPinchMove,OnPinchEnd
- OnRotationBegin,OnRotationMove,OnRotationEnd
- OnTwoFingerTap
- OnTwoFingerSwipe
- OnTwoFingerLongPress
- OnTwoFingerDragBegin,OnTwoFingerDragMove,OnTwoFingerDragEnd
[color=#02bb8 !important]方法2:使用一个DragGestureRecognizer[color=#02bb8 !important]方法3:使用“工具箱”
工具箱是一种更高级方便的方式,设计的理念是开箱就用,包括了很多脚本,但是没有涉及到核心源码,所以不用的话 可以把这个包直接删掉
FingerGestures 的事件注册是基于c#的,性能还是可以
FingerGestures is a scripting package forUnity that lets you easily detect and react to common input gesturesperformed with either a mouse or a touch screen device, using one ormore fingers.
Main Features
- Single and multi-finger gesture recognizers for Drag, Tap, Swipe, Long-Press, Pinch, Rotate
- Finger events: Down, Up, Move, Stationary
- An easy and smooth integration with Unity’s workflow
- A straightforward and streamlined event-driven API to quickly get started without digging too deep
- A rich and powerful object-oriented gesture framework for maximum control
- An efficient, low memory usage implementation
- Finger/Touch abstraction: mouse and touchscreen inputs go through the same pipe!
- A Toolbox packed with no-coding-required & ready-to-use scripts including:
- Drag & drop system
- Smooth orbit camera using drag and pinch gestures to rotate, zoom and pan
- Pinch-Zoom camera
Several easy-to-follow sample scenes that will progressively introduce you to the libraryWorks on desktop, iOS and Android platformsSupport for both Javascript and C#Includes full C# source code with comments and online documentation
转自http://cl314413.blog.163.com/blog/static/19050797620127292023453/
|
|