Gesture Tracker (Unity3D), the simplest - ljDevelopment/ljGestureTracker GitHub Wiki
The simplest gesture tracker
To track and interpret mouse / drag strokes to 4 directions.
Android: TRY IT
How to integrate...
- Create your code, options:
- From empty, create a behaviour that inherits from
GTParser
. - Modify the code of the class
GTDemoInterpreter
.
- Implements the method:
protected abstract void Do (GTGestureTracker tracker, int index, bool ended);
- Add your behaviour to an object in your project.
- Add to the project hierarchy the prefab: Plugins/GTGetureTracker/assets/prefabs/Gesture
- Drag the object 'Gesture/Canvas/gestureTracker" to the attribute 'Tracker' of your behaviour.
You can customize the elements in its hierarchy.
Toggle stroke drawing: add / remove the component in the hierarchy Gesture/Canvas/gestureTracker -> Line Drawer
API
This is the method you need to override to manage the gesture tracker events. It is invoked each time the tracker identifies a new direction.
protected abstract void Do (GTGestureTracker tracker, int index, bool ended);
- tracker: the tracker object.
- index: the index of the list
Patterns
that matches with the input, -1 if no matching. - ended: true, if the drawing finished, false in other case.
Releases
2016-04-23: 1.0.0:
- First release.