Commit 6f1b96cc authored by BRUNEAU Julien's avatar BRUNEAU Julien
Browse files

+ Spawn and Kill virtual agent according to the first and last time in their trajectory file

parent 76a11b1d
......@@ -321,16 +321,23 @@ public class FollowTrajectory : MonoBehaviour
if(!_IsLaunchable && _bIsDone)
return;
if(_SyncLaunchWithTrajectory && (CurrentTime<_Myreader.mSkeleton[0][0]))
if(_SyncLaunchWithTrajectory && CurrentTime < _Myreader.mSkeleton[0][0] && 0.2 < _Myreader.mSkeleton[0][0])
{
CurrentTime += Time.deltaTime;
_ObjectInterface.Hide();
return;
}
else if (fCurrentTime > _Myreader.mSkeleton[_Myreader.mSkeleton.Count-1][0])
{
GameObject.Destroy(this.gameObject);
return;
}
else
_ObjectInterface.Show();
if(!_ChangingParent && transform.parent != null)
if (!_ChangingParent && transform.parent != null)
{
if(_InitialPositionWhenChangingParent == Vector3.zero)
{
......
......@@ -25,11 +25,11 @@ using UnityEngine;
public class ObjectInterface
{
protected GameObject _MyObj;
protected MeshRenderer _MeshRenderer = null;
protected SkinnedMeshRenderer _MeshRenderer = null;
public void Init(GameObject obj)
{
_MyObj = obj;
_MeshRenderer = _MyObj.GetComponent<MeshRenderer>();
_MeshRenderer = _MyObj.GetComponentInChildren<SkinnedMeshRenderer>();
}
public virtual void Show()
{
......
......@@ -66,7 +66,7 @@ public class TrajectoryReader
{
// While there's lines left in the text file, do this:
int iCurrentIndex = 0;
line = theReader.ReadLine(); // skip the first line
//line = theReader.ReadLine(); // skip the first line
do
{
line = theReader.ReadLine();
......
......@@ -209,7 +209,7 @@ public class LoadEnv : MonoBehaviour
// Setup of the CSV filename and disable the start synchro
tmpFollower = temp.GetComponent<FollowTrajectory>();
tmpFollower.SetCsvFilename(f.FullName);
tmpFollower._SyncLaunchWithTrajectory = false; // start the character when the simulation start not at the csv time
tmpFollower._SyncLaunchWithTrajectory = true; // start the character at the csv time
i++;
}
......
0.124,-2.5,0
0.224,-2.5,0
0.324,-2.5,0
0.424,-2.5,0
0.524,-2.5,0
0.624,-2.5,0
0.724,-2.5,0
0.824,-2.5,0
0.924,-2.5,0
1.024,-2.5,0
1.124,-2.5,0
1.224,-2.5,0
1.324,-2.5,0
1.424,-2.5,0
1.524,-2.5,0
1.624,-2.5,0
1.724,-2.5,0
1.824,-2.5,0
1.924,-2.5,0
2.024,-2.5,0
2.124,-2.5,0
2.224,-2.5,0
2.324,-2.5,0
2.424,-2.5,0
2.524,-2.5,0
2.624,-2.5,0
2.724,-2.5,0
2.824,-2.5,0
2.924,-2.5,0
3.024,-2.5,0
3.124,-2.5,0
3.224,-2.5,0
3.324,-2.5,0
3.424,-2.5,0
3.524,-2.5,0
3.624,-2.5,0
3.724,-2.5,0
3.824,-2.5,0
3.924,-2.5,0
4.024,-2.5,0
4.124,-2.5,0
4.224,-2.5,0
4.324,-2.5,0
4.424,-2.5,0
4.524,-2.5,0
4.624,-2.5,0
4.724,-2.5,0
4.824,-2.5,0
4.924,-2.5,0
5.024,-2.5,0
5.124,-2.5,0
5.224,-2.5,0
5.324,-2.5,0
5.424,-2.5,0
5.524,-2.5,0
5.624,-2.5,0
5.724,-2.5,0
5.824,-2.5,0
5.924,-2.5,0
6.024,-2.5,0
6.124,-2.5,0
6.224,-2.5,0
6.324,-2.5,0
6.424,-2.5,0
6.524,-2.5,0
6.624,-2.5,0
6.724,-2.5,0
6.824,-2.5,0
6.924,-2.5,0
7.024,-2.5,0
7.124,-2.5,0
7.224,-2.5,0
7.324,-2.5,0
7.424,-2.5,0
7.524,-2.5,0
7.624,-2.5,0
7.724,-2.5,0
7.824,-2.5,0
7.924,-2.5,0
8.024,-2.5,0
8.124,-2.5,0
8.224,-2.5,0
8.324,-2.5,0
8.424,-2.5,0
8.524,-2.5,0
8.624,-2.5,0
8.724,-2.5,0
8.824,-2.5,0
8.924,-2.5,0
9.024,-2.5,0
9.124,-2.5,0
9.224,-2.5,0
9.324,-2.5,0
9.424,-2.5,0
9.524,-2.5,0
9.624,-2.5,0
9.724,-2.5,0
9.824,-2.5,0
9.924,-2.5,0
10.024,-2.5,0
10.124,-2.5,0
10.224,-2.5,0
10.324,-2.5,0
10.424,-2.5,0
10.524,-2.5,0
10.624,-2.5,0
10.724,-2.5,0
10.824,-2.5,0
10.924,-2.5,0
11.024,-2.5,0
11.124,-2.5,0
11.224,-2.5,0
11.324,-2.5,0
11.424,-2.5,0
11.524,-2.5,0
11.624,-2.5,0
11.724,-2.5,0
11.824,-2.5,0
11.924,-2.5,0
12.024,-2.5,0
12.124,-2.5,0
12.224,-2.5,0
12.324,-2.5,0
12.424,-2.5,0
12.524,-2.5,0
12.624,-2.5,0
12.724,-2.5,0
12.824,-2.5,0
12.924,-2.5,0
13.024,-2.5,0
13.124,-2.5,0
13.224,-2.5,0
13.324,-2.5,0
13.424,-2.5,0
13.524,-2.5,0
13.624,-2.5,0
13.724,-2.5,0
13.824,-2.5,0
13.924,-2.5,0
14.024,-2.5,0
14.124,-2.5,0
14.224,-2.5,0
14.324,-2.5,0
14.424,-2.5,0
14.524,-2.5,0
14.624,-2.5,0
14.724,-2.5,0
14.824,-2.5,0
14.924,-2.5,0
15.024,-2.5,0
15.124,-2.5,0
15.224,-2.5,0
15.324,-2.5,0
15.424,-2.5,0
15.524,-2.5,0
15.624,-2.5,0
15.724,-2.5,0
15.824,-2.5,0
15.924,-2.5,0
16.024,-2.5,0
16.124,-2.5,0
16.224,-2.5,0
16.324,-2.5,0
16.424,-2.5,0
16.524,-2.5,0
16.624,-2.5,0
16.724,-2.5,0
16.824,-2.5,0
16.924,-2.5,0
17.024,-2.5,0
17.124,-2.5,0
17.224,-2.5,0
17.324,-2.5,0
17.424,-2.5,0
17.524,-2.5,0
17.624,-2.5,0
17.724,-2.5,0
17.824,-2.5,0
17.924,-2.5,0
18.024,-2.5,0
18.124,-2.5,0
18.224,-2.5,0
18.324,-2.5,0
18.424,-2.5,0
18.524,-2.5,0
18.624,-2.5,0
18.724,-2.5,0
18.824,-2.5,0
18.924,-2.5,0
19.024,-2.5,0
19.124,-2.5,0
19.224,-2.5,0
19.324,-2.5,0
19.424,-2.5,0
19.524,-2.5,0
19.624,-2.5,0
19.724,-2.5,0
19.824,-2.5,0
19.924,-2.5,0
20.024,-2.5,0
20.124,-2.5,0
20.224,-2.5,0
20.324,-2.5,0
20.424,-2.5,0
20.524,-2.5,0
20.624,-2.5,0
20.724,-2.5,0
20.824,-2.5,0
20.924,-2.5,0
21.024,-2.5,0
21.124,-2.5,0
21.224,-2.5,0
21.324,-2.5,0
21.424,-2.5,0
21.524,-2.5,0
21.624,-2.5,0
21.724,-2.5,0
21.824,-2.5,0
21.924,-2.5,0
22.024,-2.5,0
22.124,-2.5,0
22.224,-2.5,0
22.324,-2.5,0
22.424,-2.5,0
22.524,-2.5,0
22.624,-2.5,0
22.724,-2.5,0
22.824,-2.5,0
22.924,-2.5,0
23.024,-2.5,0
23.124,-2.5,0
23.224,-2.5,0
23.324,-2.5,0
23.424,-2.5,0
23.524,-2.5,0
23.624,-2.5,0
23.724,-2.5,0
23.824,-2.5,0
23.924,-2.5,0
24.024,-2.5,0
24.124,-2.5,0
24.224,-2.5,0
24.324,-2.5,0
24.424,-2.5,0
24.524,-2.5,0
24.624,-2.5,0
24.724,-2.5,0
24.824,-2.5,0
24.924,-2.5,0
25.024,-2.5,0
25.124,-2.5,0
25.224,-2.5,0
25.324,-2.5,0
25.424,-2.5,0
25.524,-2.5,0
25.624,-2.5,0
25.724,-2.5,0
25.824,-2.5,0
25.924,-2.5,0
26.024,-2.5,0
26.124,-2.5,0
26.224,-2.5,0
26.324,-2.5,0
26.424,-2.5,0
26.524,-2.5,0
26.624,-2.5,0
26.724,-2.5,0
26.824,-2.5,0
26.924,-2.5,0
27.024,-2.5,0
27.124,-2.5,0
27.224,-2.5,0
27.324,-2.5,0
27.424,-2.5,0
27.524,-2.5,0
27.624,-2.5,0
27.724,-2.5,0
27.824,-2.5,0
27.924,-2.5,0
28.024,-2.5,0
28.124,-2.5,0
28.224,-2.5,0
28.324,-2.5,0
28.424,-2.5,0
28.524,-2.5,0
28.624,-2.5,0
28.724,-2.5,0
28.824,-2.5,0
28.924,-2.5,0
29.024,-2.5,0
29.124,-2.5,0
29.224,-2.5,0
29.324,-2.5,0
29.424,-2.5,0
29.524,-2.5,0
29.624,-2.5,0
29.724,-2.5,0
29.824,-2.5,0
29.924,-2.5,0
30.024,-2.5,0
30.124,-2.5,0
30.224,-2.5,0
30.324,-2.5,0
30.424,-2.5,0
30.524,-2.5,0
30.624,-2.5,0
30.724,-2.5,0
30.824,-2.5,0
30.924,-2.5,0
31.024,-2.5,0
31.124,-2.5,0
31.224,-2.5,0
31.324,-2.5,0
31.424,-2.5,0
31.524,-2.5,0
31.624,-2.5,0
31.724,-2.5,0
31.824,-2.5,0
31.924,-2.5,0
32.024,-2.5,0
32.124,-2.5,0
32.224,-2.5,0
32.324,-2.5,0
32.424,-2.5,0
32.524,-2.5,0
32.624,-2.5,0
32.724,-2.5,0
32.824,-2.5,0
32.924,-2.5,0
33.024,-2.5,0
33.124,-2.5,0
33.224,-2.5,0
33.324,-2.5,0
33.424,-2.5,0
33.524,-2.5,0
33.624,-2.5,0
33.724,-2.5,0
33.824,-2.5,0
33.924,-2.5,0
34.024,-2.5,0
34.124,-2.5,0
34.224,-2.5,0
34.324,-2.5,0
34.424,-2.5,0
34.524,-2.5,0
34.624,-2.5,0
34.724,-2.5,0
34.824,-2.5,0
34.924,-2.5,0
35.024,-2.5,0
35.124,-2.5,0
35.224,-2.5,0
35.324,-2.5,0
35.424,-2.5,0
35.524,-2.5,0
35.624,-2.5,0
35.724,-2.5,0
35.824,-2.5,0
35.924,-2.5,0
36.024,-2.5,0
36.124,-2.5,0
36.224,-2.5,0
36.324,-2.5,0
36.424,-2.5,0
36.524,-2.5,0
36.624,-2.5,0
36.724,-2.5,0
36.824,-2.5,0
36.924,-2.5,0
37.024,-2.5,0
37.124,-2.5,0
37.224,-2.5,0
37.324,-2.5,0
37.424,-2.5,0
37.524,-2.5,0
37.624,-2.5,0
37.724,-2.5,0
37.824,-2.5,0
37.924,-2.5,0
38.024,-2.5,0
38.124,-2.5,0
38.224,-2.5,0
38.324,-2.5,0
38.424,-2.5,0
38.524,-2.5,0
38.624,-2.5,0
38.724,-2.5,0
38.824,-2.5,0
38.924,-2.5,0
39.024,-2.5,0
39.124,-2.5,0
39.224,-2.5,0
39.324,-2.5,0
39.424,-2.5,0
39.524,-2.5,0
39.624,-2.5,0
39.724,-2.5,0
39.824,-2.5,0
39.924,-2.5,0
40.024,-2.5,0
40.124,-2.5,0
40.224,-2.5,0
40.324,-2.5,0
40.424,-2.5,0
40.524,-2.5,0
40.624,-2.5,0
40.724,-2.5,0
40.824,-2.5,0
40.924,-2.5,0
41.024,-2.5,0
41.124,-2.5,0
41.224,-2.5,0
41.324,-2.5,0
41.424,-2.5,0
41.524,-2.5,0
41.624,-2.5,0
41.724,-2.5,0
41.824,-2.5,0
41.924,-2.5,0
42.024,-2.5,0
42.124,-2.5,0
42.224,-2.5,0
42.324,-2.5,0
42.424,-2.5,0
42.524,-2.5,0
42.624,-2.5,0
42.724,-2.5,0
42.824,-2.5,0
42.924,-2.5,0
43.024,-2.5,0
43.124,-2.5,0
43.224,-2.5,0
43.324,-2.5,0
43.424,-2.5,0
43.524,-2.5,0
43.624,-2.5,0
43.724,-2.5,0
43.824,-2.5,0
43.924,-2.5,0
44.024,-2.5,0
44.124,-2.5,0
44.224,-2.5,0
44.324,-2.5,0
44.424,-2.5,0
44.524,-2.5,0
44.624,-2.5,0
44.724,-2.5,0
44.824,-2.5,0
44.924,-2.5,0
45.024,-2.5,0
45.124,-2.5,0
45.224,-2.5,0
45.324,-2.5,0
45.424,-2.5,0
45.524,-2.5,0
45.624,-2.5,0
45.724,-2.5,0
45.824,-2.5,0
45.924,-2.5,0
46.024,-2.5,0
46.124,-2.5,0
46.224,-2.5,0
46.324,-2.5,0
46.424,-2.5,0
46.524,-2.5,0
46.624,-2.5,0
46.724,-2.5,0
46.824,-2.5,0
46.924,-2.5,0
47.024,-2.5,0
47.124,-2.5,0
47.224,-2.5,0
47.324,-2.5,0
47.424,-2.5,0
47.524,-2.5,0
47.624,-2.5,0
47.724,-2.5,0
47.824,-2.5,0
47.924,-2.5,0
48.024,-2.5,0
48.124,-2.5,0
48.224,-2.5,0
48.324,-2.5,0
48.424,-2.5,0
48.524,-2.5,0
48.624,-2.5,0
48.724,-2.5,0
48.824,-2.5,0
48.924,-2.5,0
49.024,-2.5,0
49.124,-2.5,0
49.224,-2.5,0
49.324,-2.5,0
49.424,-2.5,0
49.524,-2.5,0
49.624,-2.5,0
49.724,-2.5,0
49.824,-2.5,0
49.924,-2.5,0
50.024,-2.5,0
50.124,-2.5,0
50.224,-2.5,0
50.324,-2.5,0
50.424,-2.5,0
50.524,-2.5,0
50.624,-2.5,0
50.724,-2.5,0
50.824,-2.5,0
50.924,-2.5,0
51.024,-2.5,0
51.124,-2.5,0
51.224,-2.5,0
51.324,-2.5,0
51.424,-2.5,0
51.524,-2.5,0
51.624,-2.5,0
51.724,-2.5,0
51.824,-2.5,0
51.924,-2.5,0
52.024,-2.5,0
52.124,-2.5,0
52.224,-2.5,0
52.324,-2.5,0
52.424,-2.5,0
52.524,-2.5,0
52.624,-2.5,0
52.724,-2.5,0
52.824,-2.5,0
52.924,-2.5,0
53.024,-2.5,0
53.124,-2.5,0
53.224,-2.5,0
53.324,-2.5,0
53.424,-2.5,0
53.524,-2.5,0
53.624,-2.5,0
53.724,-2.5,0
53.824,-2.5,0
53.924,-2.5,0
54.024,-2.5,0
54.124,-2.5,0
54.224,-2.5,0
54.324,-2.5,0
54.424,-2.5,0
54.524,-2.5,0
54.624,-2.5,0
54.724,-2.5,0
54.824,-2.5,0
54.924,-2.5,0
55.024,-2.5,0
55.124,-2.5,0
55.224,-2.5,0
55.324,-2.5,0
55.424,-2.5,0
55.524,-2.5,0
55.624,-2.5,0
55.724,-2.5,0
55.824,-2.5,0
55.924,-2.5,0
56.024,-2.5,0
56.124,-2.5,0
56.224,-2.5,0
56.324,-2.5,0
56.424,-2.5,0
56.524,-2.5,0
56.624,-2.5,0
56.724,-2.5,0
56.824,-2.5,0
56.924,-2.5,0
57.024,-2.5,0
57.124,-2.5,0