That isn't one of the Leap Motion scripts. To do what you want, you can use something like this:
using UnityEngine;
using System.Collections;
using Leap;
public class MatchHand : MonoBehaviour {
//Assume a reference to the scene HandController object
public HandController handCtrl;
void Update(){
Frame frame = handCtrl.GetFrame();
Hand hand = frame.Hands.Frontmost;
if(hand.IsValid) {
transform.position =
handCtrl.transform.TransformPoint(hand.PalmPosition.ToUnityScaled());
transform.rotation =
handCtrl.transform.rotation * hand.Basis.Rotation(false);
}
}
}
This moves the object to which it is attached to the position of your hand over the Leap Motion hardware. Units are in millimeters, so unless the object is close to the camera in your scene (as would probably be the case in VR/AR), you will have to scale up the position to see appreciable movement. The rotation of the object is also set to match your hand.
This requires a HandController object from the Leap Motion core assets. You can just set the hand models to None if you don't want them to appear. (This can be done easily without the Core assets at all, but you would have to define the ToUnityScaled() and Rotation() extensions used to convert from the Leap Motion frame of reference to the Unity frame of reference.)