Skip to content
This repository was archived by the owner on Jul 30, 2021. It is now read-only.

Commit

Permalink
fix #32
Browse files Browse the repository at this point in the history
  • Loading branch information
esm-tmori committed Feb 19, 2021
1 parent 141e594 commit 7d6060d
Showing 1 changed file with 6 additions and 14 deletions.
20 changes: 6 additions & 14 deletions Assets/Scripts/Hakoniwa/Core/WorldController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,10 @@ void FixedUpdate()
* Check diff time and connection.
*/
foreach (IAssetController asset in this.assets) {
this.diff_time[index] = (long)asset.GetControllerTime() - (long)this.unity_simtime;
this.dbgDiffTimeMsec[index] = ((double)this.diff_time[index]) / 1000;
this.dbgMiconStimeSec[index] = ((double)asset.GetControllerTime()) / 1000000;

if (this.diff_time[index] <= -this.maxDiffTime)
{
canStep = false;
Expand All @@ -61,6 +65,8 @@ void FixedUpdate()
}
index++;
}
this.dbgUnityStimeSec = ((double)this.unity_simtime) / 1000000;

/*
* judge simulation can step
*/
Expand All @@ -84,20 +90,6 @@ void FixedUpdate()
{
asset.DoPublish(this.unity_simtime);
}
}
void Update()
{
int index = 0;
foreach (IAssetController asset in this.assets)
{
this.diff_time[index] = (long)asset.GetControllerTime() - (long)this.unity_simtime;
this.dbgDiffTimeMsec[index] = ((double)this.diff_time[index]) / 1000;
this.dbgMiconStimeSec[index] = ((double)asset.GetControllerTime()) / 1000000;
index++;
}
this.dbgUnityStimeSec = ((double)this.unity_simtime) / 1000000;


}
public double GetSimTime()
{
Expand Down

0 comments on commit 7d6060d

Please sign in to comment.