|
@@ -44,7 +44,6 @@ public class PlayerReplay : MonoBehaviour
|
|
|
|
|
|
public void AddJoints()
|
|
|
{
|
|
|
- // TODO: still not working, all elements are replaced with new added array
|
|
|
Vector3[] positions = new Vector3[25];
|
|
|
|
|
|
for(int i = 0; i < joints.Length; i++)
|
|
@@ -77,13 +76,12 @@ public class PlayerReplay : MonoBehaviour
|
|
|
}
|
|
|
|
|
|
StartCoroutine(ShowJoints(data));
|
|
|
-
|
|
|
Debug.Log("Load success");
|
|
|
}
|
|
|
|
|
|
private IEnumerator ShowJoints(JointsDataSequence data)
|
|
|
{
|
|
|
- // Show joints every 2 seconds
|
|
|
+ // Show joints one by one every 2 seconds
|
|
|
WaitForSeconds wait = new WaitForSeconds(2);
|
|
|
List<JointsData> jointsData = data.jointsDataSequence;
|
|
|
int counter = 0;
|
|
@@ -119,19 +117,17 @@ public class PlayerReplay : MonoBehaviour
|
|
|
if (!_BoneMap.ContainsKey(jt) || jt == Kinect.JointType.Neck)
|
|
|
continue;
|
|
|
|
|
|
-
|
|
|
Transform jointObj = body.transform.Find(jt.ToString());
|
|
|
- LineRenderer lr = jointObj.GetComponent<LineRenderer>();
|
|
|
-
|
|
|
-
|
|
|
Transform targetJoint = body.transform.Find(_BoneMap[jt].ToString());
|
|
|
+ LineRenderer lr = jointObj.GetComponent<LineRenderer>();
|
|
|
|
|
|
lr.SetPosition(0, jointObj.localPosition);
|
|
|
lr.SetPosition(1, targetJoint.localPosition);
|
|
|
}
|
|
|
|
|
|
- counter++;
|
|
|
yield return wait;
|
|
|
+ counter++;
|
|
|
+ Destroy(body);
|
|
|
}
|
|
|
}
|
|
|
}
|