Я делаю игру, в которой система сохранения и загрузки будет отображаться, когда я окажусь перед моей ладонью. Проблема в том, что я не знаю, как я могу определить, обращена ли моя ладонь. Все, что я знаю, это то, как получить расстояние и положение на ладони.Как определить, направлен ли рука в прыжке вверх (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
Можете ли вы показать мне образец этого сэра. пожалуйста, – TheGinxx009
Смотрите функцию palmWatcher здесь: https://github.com/leapmotion/UnityModules/blob/develop/Assets/LeapMotion/Scripts/DetectionUtilities/PalmDirectionDetector.cs –