private void Update()
{
KinectManager manager = KinectManager.Instance;
if (!manager || !manager.IsInitialized() || !manager.IsUserDetected())
{
return;
}
int iJointIndex = (int)TrackedJoint;
if (manager.IsUserDetected())
{
uint userId = manager.GetPlayer1ID();
if (manager.IsJointTracked(userId, iJointIndex))
{
Vector3 posJoint = manager.GetRawSkeletonJointPos(userId, iJointIndex);
if (posJoint != Vector3.zero)
{
if (posJoint.x <= rangMax && posJoint.x >= rangMin)
{
SceneManager.LoadScene("Interaccio");
}
}
}
}
}