【发布时间】:2017-02-21 09:21:26
【问题描述】:
我使用统一并在 Kinect 360 上工作是版本 1,我创建新场景并正在处理 2D 空间,我还在场景中心创建 UI 按钮和另一个 UI 按钮,但我将其修改为小圆圈和我把它命名为游标 现在我想用右手移动光标 希望被 Kinect 检测到 所以我陷入了
的错误{
transform.position assign attempt for 'cursor' is not valid .Input position is{-Infinity,-777756757673984982383290000000000000000000000,0,0}
}
我的代码在这里
void Update () {
KinectManager manager = KinectManager.Instance;
if (DepthImageViewer.Instance.jointColliders != null)
{
if (!isInited)
{
isInited = true;
initialPosition = new Vector2((DepthImageViewer.Instance.jointColliders[11].transform.position.x + 50) * 19.2f, (DepthImageViewer.Instance.jointColliders[11].transform.position.y + 50) * 10.8f);//, DepthImageViewer.Instance.jointColliders[11].transform.position.z);
}
Vector2 newPos = new Vector2((DepthImageViewer.Instance.jointColliders[11].transform.position.x + 50) * 19.2f - offstX, (DepthImageViewer.Instance.jointColliders[11].transform.position.y + 50) * 10.8f - offstY) - initialPosition;//, DepthImageViewer.Instance.jointColliders[11].transform.position.z) - initialPosition;
Debug.Log(DepthImageViewer.Instance.jointColliders[11].transform.position);
}
else
{
Debug.Log("not joint colliders");
}
}
【问题讨论】: