1
私は手のひらを上にしたときにセーブおよびロードシステムが表示されるゲームを作っています。問題は、私の手のひらが上を向いているかどうかをどのように検出できるかわかりません。私が知っているのは、手のひらの距離と位置を得る方法です。跳躍動作の手が上を向いているかどうかを検出する方法(C#)Unity
私はこの試みた:
using Leap;
using Leap.Unity;
public class GetPamlPositionLeap : MonoBehaviour {
LeapProvider provider;
// Use this for initialization
void Start() {
provider = FindObjectOfType<LeapProvider>() as LeapProvider;
}
// Update is called once per frame
void Update() {
Frame frame = provider.CurrentFrame;
Hand hand = frame.Hand [0]; // cannot apply indexing
Vector position = hand.PalmPosition;
Vector direction = hand.Direction;
Debug.Log ("The position of hand is" + position + "The direction of hand is" + direction);
}
}
をしかし、それはエラーを返します:
cannot apply indexing to an expression type
あなたはこの先生のサンプルを私に見せてもらえますか? please – TheGinxx009
palmWatcher関数を参照してください:https://github.com/leapmotion/UnityModules/blob/develop/Assets/LeapMotion/Scripts/DetectionUtilities/PalmDirectionDetector.cs –