public void OnFingerSet(Lean.LeanFinger finger)
	{
		// Right side of the screen?
		if (finger.ScreenPosition.x > Screen.width / 2)
		{
			// Does it exist?
			if (RightObject != null)
			{
				// Position it in front of the finger
				RightObject.position = finger.GetWorldPosition(10.0f);
			}
		}
		// Left side?
		else
		{
			// Does it exist?
			if (RightObject != null)
			{
				// Position it in front of the finger
				LeftObject.position = finger.GetWorldPosition(10.0f);
			}
		}
		
		// NOTE: If you want to prevent fingers from crossing sides then you can check finger.StartScreenPosition first
	}
Beispiel #2
0
	public void OnFingerTap(Lean.LeanFinger finger)
	{
		// Does the prefab exist?
		if (Prefab != null)
		{
			// Make sure the finger isn't over any GUI elements
			if (finger.IsOverGui == false)
			{
				// Clone the prefab, and place it where the finger was tapped
				var position = finger.GetWorldPosition(50.0f);
				var rotation = Quaternion.identity;
				Debug.Log ("Finger Tap!");
			}
		}
	}
Beispiel #3
0
	public void OnFingerTap(Lean.LeanFinger finger)
	{
		// Does the prefab exist?
		if (Prefab != null)
		{
			// Make sure the finger isn't over any GUI elements
			if (finger.IsOverGui == false)
			{
				// Clone the prefab, and place it where the finger was tapped
				var position = finger.GetWorldPosition(50.0f);
				var rotation = Quaternion.identity;
				var clone    = (GameObject)Instantiate(Prefab, position, rotation);
				
				// Make sure the prefab gets destroyed after some time
				Destroy(clone, 2.0f);
			}
		}
	}