|
@@ -44,7 +44,13 @@ public class PlayerReplay : MonoBehaviour
|
|
|
|
|
|
public void AddJoints()
|
|
|
{
|
|
|
+ // TODO: still not working, all elements are replaced with new added array
|
|
|
jointsSequence.Add(joints);
|
|
|
+
|
|
|
+ foreach(Transform[] t in jointsSequence)
|
|
|
+ {
|
|
|
+ Debug.Log("debug: " + t[0].position);
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
public void Save()
|
|
@@ -78,11 +84,12 @@ public class PlayerReplay : MonoBehaviour
|
|
|
// Show joints every 2 seconds
|
|
|
WaitForSeconds wait = new WaitForSeconds(2);
|
|
|
List<JointsData> jointsData = data.jointsDataSequence;
|
|
|
+ int counter = 0;
|
|
|
|
|
|
foreach(JointsData jd in jointsData)
|
|
|
{
|
|
|
// Create GameObject body
|
|
|
- GameObject body = new GameObject("Recorded Body");
|
|
|
+ GameObject body = new GameObject("Recorded Body " + counter);
|
|
|
for (Kinect.JointType jt = Kinect.JointType.SpineBase; jt <= Kinect.JointType.ThumbRight; jt++)
|
|
|
{
|
|
|
// skip if head joint
|
|
@@ -121,6 +128,7 @@ public class PlayerReplay : MonoBehaviour
|
|
|
lr.SetPosition(1, targetJoint.localPosition);
|
|
|
}
|
|
|
|
|
|
+ counter++;
|
|
|
yield return wait;
|
|
|
}
|
|
|
}
|