1. How to join leantouch.

After you've installed the leantouch, there's a lean> touch in gameobject.


2. An example of creating prefab by clicking on a screen.

2. 1 building a scene to join leantouch.

2. 2 build a square, drag to asset, turn to prefab.
2. 3 in leantouch ( gameobject ), build leanspawn ( component ) and drag the block into prefab.

2. 4 continue to establish the action of leanfingerdown, selecting objects for the clicked event ( leantouch, I. E. Leanspawn ), and selects leanspawn. Spawn in function.

Distance in 2. 5 leanspawn is the distance to the camera.
is done, and clicking on the screen will appear a box.

A simple format for 3. C #.

3. 1 increase click event.


3. 2 real-time access to finger information.


3. 3 Lean.Touch. leangesture can implement multiple operations, such as rotation.

3. 4 leaving UI no action.


3. 5 uses using lean, touch;.


A combination of 3. 6 provides multiple operatio &.
Leangesture. Getpinchscale ( leantouch. Getfingers ( true ) ).

4. Set the order of the trigger action to resolve the problem of the input delay frame.

4. 1 edit from project settings to script execution order.
4. 2 setting order.

5. Camera.

5. 1 leancameramove.
Let the camera be dragged by finger.
5. 2 leancamerazoom.
So that the camera can be.
5. 3 leancameramovesmooth.
Allows the camera to be dragged by finger, and the effect is smoother.
5. 4 leancamerazoomsmooth.
The camera can be amplified by, and the effect is smoother.
5. 5 leanpitchyaw.
Let the camera go around and watch around space.
5. 5 leanpitchyawsmooth.
Makes the camera orbit around the space, and the effect is smoother.

6. Finger.

6. 1 leanfingertap.
Tap to unde & tand as when requiredtapinterval is 2
When ignoreifovergui is set, it can be invalidated on the UI

6. 2 leanspawn.
Set a precast body and set the distance from the camera

6. 3 leandestroy.
Set the time to destroy

6. 4 leanfingerheld.
Long press

6. 5 leanfingerline.
Drag to create a line

6. 6 leanmultitap.
by connecting a script, passing count, highest,



6. 6 leanfingertrail.
Keep track of your fingers.

6. 7 leanopenurl.
Links can be implemented by button

6. 8 leanpressselect to set the object to be clicked and dragged.
After leanpressselect settings, you'll be saved in currentselectables by clicking multiple points

6. 9 leanselectablespriterenderercolor.
By adding a"leanselectablespriterenderercolor"script on a clicked object, you can click on the, and note that the clicked needs to join the circlecollider2d 3d collision component, and SpriteRenderer. And leanselectable is also required.

6. 10 LeanSelectable.
By adding an action to select, leanselectable can be used to set leandestroy. Destroynow to remove.

6. 11 LeanTranslate.
Adding leantranslate to the object, with the above components, can implement object drag, leantranslatesmooth can smooth points.

6. 12 implements 3d objects to be clicked and dragged.
In leanpressselect, selectusing set raycast,
A leanselectablerenderercolor can set the color change of a 3d object.

6. 13 LeanSelectableTranslateInertia3D.
A leanselectabletranslateinertia 3d can combine a rigid body to set a drag.

6. 14 LeanTapSelect.
Choose an object for an object, and the selected object is recorded in currentselectable, which can only be selected

6. 15 LeanRotate.
Rotate, set x, y, z axis corresponding rotation

6. 16 LeanScale.
Zoom in.

7. Swipe.

7. 1 leanswipedirection4.
Slide in four directions

7. 2 leanswipedirection8.
Slide in eight directions

7. 3 leanswiperigidbody2d/3d leanswiperigidbody2d/3dnorelease.
Rigid body sliding

8. Gesture.

8. 1 leantouchevents.

using UnityEngine;

using System.Collections.Generic;

namespace Lean.Touch


 //This script will hook into event LeanTouch event, and spam the console with the information

 public class LeanTouchEvents : MonoBehaviour


 protected virtual void OnEnable()


 //Hook into the events we need

 LeanTouch.OnFingerDown += OnFingerDown;

 LeanTouch.OnFingerSet += OnFingerSet;

 LeanTouch.OnFingerUp += OnFingerUp;

 LeanTouch.OnFingerTap += OnFingerTap;

 LeanTouch.OnFingerSwipe += OnFingerSwipe;

 LeanTouch.OnGesture += OnGesture;


 protected virtual void OnDisable()


 //Unhook the events

 LeanTouch.OnFingerDown -= OnFingerDown;

 LeanTouch.OnFingerSet -= OnFingerSet;

 LeanTouch.OnFingerUp -= OnFingerUp;

 LeanTouch.OnFingerTap -= OnFingerTap;

 LeanTouch.OnFingerSwipe -= OnFingerSwipe;

 LeanTouch.OnGesture -= OnGesture;


 public void OnFingerDown(LeanFinger finger)


 Debug.Log("Finger" + finger.Index + " began touching the screen");


 public void OnFingerSet(LeanFinger finger)


 Debug.Log("Finger" + finger.Index + " is still touching the screen");


 public void OnFingerUp(LeanFinger finger)


 Debug.Log("Finger" + finger.Index + " finished touching the screen");


 public void OnFingerTap(LeanFinger finger)


 Debug.Log("Finger" + finger.Index + " tapped the screen");


 public void OnFingerSwipe(LeanFinger finger)


 Debug.Log("Finger" + finger.Index + " swiped the screen");


 public void OnGesture(List<LeanFinger> fingers)


 Debug.Log("Gesture with" + fingers.Count + " finger(s)");

 Debug.Log(" pinch scale:" + LeanGesture.GetPinchScale(fingers));

 Debug.Log(" twist degrees:" + LeanGesture.GetTwistDegrees(fingers));

 Debug.Log(" twist radians:" + LeanGesture.GetTwistRadians(fingers));

 Debug.Log(" screen delta:" + LeanGesture.GetScreenDelta(fingers));




9. How to make an object can be pushed by tap.

9. 1 increased a leantouch.
9. 2 adds a leantapselect and selects it to be 2d 3d ( select using ).



9. 3 on object, join leanselectable and ensure that collider is in.


9. 4 can use some of the functions of leanselect, or you can add actions to the event.
Pull the object with leanselectable and select a handler to get it.

Copyright © 2011 Dowemo All rights reserved.    Creative Commons   AboutUs