time fix
This commit is contained in:
@@ -1,5 +1 @@
|
||||
<<<<<<< HEAD
|
||||
{"count":1,"self":119.0030848,"total":122.1256981,"children":{"InitializeActuators":{"count":8,"self":0.002503,"total":0.002503,"children":null},"InitializeSensors":{"count":8,"self":0.0015129,"total":0.0015129,"children":null},"AgentSendState":{"count":4974,"self":0.3274958,"total":0.40929109999999996,"children":{"CollectObservations":{"count":7960,"self":0.041415299999999995,"total":0.041415299999999995,"children":null},"WriteActionMask":{"count":7960,"self":0.0062821,"total":0.0062821,"children":null},"RequestDecision":{"count":7960,"self":0.0340979,"total":0.0340979,"children":null}}},"DecideAction":{"count":4974,"self":2.3696098,"total":2.4060512999999997,"children":{"RayPerceptionSensor.Perceive":{"count":15920,"self":0.0364415,"total":0.0364415,"children":null}}},"AgentAct":{"count":4974,"self":0.30275369999999996,"total":0.30275369999999996,"children":null}},"gauges":{"Benson Track2.CumulativeReward":{"count":7,"max":25.9936028,"min":22.422739,"runningAverage":23.9171925,"value":25.9936028,"weightedAverage":24.25875}},"metadata":{"timer_format_version":"0.1.0","start_time_seconds":"1714130760","unity_version":"2022.3.11f1","command_line_arguments":"C:\\Program Files\\Unity\\Hub\\Editor\\2022.3.11f1\\Editor\\Unity.exe -projectpath C:\\Users\\noahk\\Documents\\Unity projects\\Racesm -useHub -hubIPC -cloudEnvironment production -licensingIpc LicenseClient-noahk -hubSessionId a6f45e0e-41b6-4c96-a70e-ec8e10ca5aa9 -accessToken LhF-MiZYoHmiI2p1_6JvQZvJ6QUPd4VyLbrTbhNHTT8005f","communication_protocol_version":"1.5.0","com.unity.ml-agents_version":"2.0.1","scene_name":"WinScreen","end_time_seconds":"1714130882"}}
|
||||
=======
|
||||
{"count":1,"self":314.6955008,"total":335.1372398,"children":{"InitializeActuators":{"count":8,"self":0.0019959,"total":0.0019959,"children":null},"InitializeSensors":{"count":8,"self":0.0019916,"total":0.0019916,"children":null},"AgentSendState":{"count":8217,"self":1.5569809,"total":1.9225938,"children":{"CollectObservations":{"count":12800,"self":0.2236146,"total":0.2236146,"children":null},"WriteActionMask":{"count":12800,"self":0.041617299999999996,"total":0.041617299999999996,"children":null},"RequestDecision":{"count":12800,"self":0.100381,"total":0.100381,"children":null}}},"DecideAction":{"count":8217,"self":17.056696,"total":17.3266492,"children":{"RayPerceptionSensor.Perceive":{"count":25600,"self":0.2699526,"total":0.2699526,"children":null}}},"AgentAct":{"count":8217,"self":1.1885037,"total":1.1885037,"children":null}},"gauges":{"Benson Track2.CumulativeReward":{"count":21,"max":25.5467758,"min":21.5942726,"runningAverage":24.3378487,"value":24.4405937,"weightedAverage":24.7650566}},"metadata":{"timer_format_version":"0.1.0","start_time_seconds":"1714130246","unity_version":"2022.3.11f1","command_line_arguments":"C:\\Program Files\\Unity\\Hub\\Editor\\2022.3.11f1\\Editor\\Unity.exe -projectpath C:\\Users\\Magnus\\Desktop\\Ny unityting\\Racesm -useHub -hubIPC -cloudEnvironment production -licensingIpc LicenseClient-Magnus -hubSessionId 8c17471b-7795-4082-905c-75744d6a077b -accessToken hv3zp4IA8nxcowfZc35r5tDHrlmzUZoExTBgESksngo005f","communication_protocol_version":"1.5.0","com.unity.ml-agents_version":"2.0.1","scene_name":"WinScreen","end_time_seconds":"1714130581"}}
|
||||
>>>>>>> 2a3284ac7c7577c027d1ab933ed82def95da0f94
|
||||
{"count":1,"self":118.3093504,"total":120.47375129999999,"children":{"InitializeActuators":{"count":8,"self":0.0010007,"total":0.0010007,"children":null},"InitializeSensors":{"count":8,"self":0.0020283,"total":0.0020283,"children":null},"AgentSendState":{"count":3805,"self":0.20863199999999998,"total":0.2612761,"children":{"CollectObservations":{"count":6088,"self":0.0274956,"total":0.0274956,"children":null},"WriteActionMask":{"count":6088,"self":0.0030364,"total":0.0030364,"children":null},"RequestDecision":{"count":6088,"self":0.0221121,"total":0.0221121,"children":null}}},"DecideAction":{"count":3805,"self":1.6640274,"total":1.6968463999999999,"children":{"RayPerceptionSensor.Perceive":{"count":12176,"self":0.032819,"total":0.032819,"children":null}}},"AgentAct":{"count":3805,"self":0.2032522,"total":0.2032522,"children":null}},"gauges":{"Benson Track2.CumulativeReward":{"count":7,"max":25.4471169,"min":20.8521976,"runningAverage":23.9435921,"value":20.8521976,"weightedAverage":23.3001652}},"metadata":{"timer_format_version":"0.1.0","start_time_seconds":"1714131242","unity_version":"2022.3.11f1","command_line_arguments":"C:\\Program Files\\Unity\\Hub\\Editor\\2022.3.11f1\\Editor\\Unity.exe -projectpath C:\\Users\\noahk\\Documents\\Unity projects\\Racesm -useHub -hubIPC -cloudEnvironment production -licensingIpc LicenseClient-noahk -hubSessionId a6f45e0e-41b6-4c96-a70e-ec8e10ca5aa9 -accessToken LhF-MiZYoHmiI2p1_6JvQZvJ6QUPd4VyLbrTbhNHTT8005f","communication_protocol_version":"1.5.0","com.unity.ml-agents_version":"2.0.1","scene_name":"WinScreen","end_time_seconds":"1714131362"}}
|
||||
@@ -33,7 +33,7 @@ public class GameManager : MonoBehaviour
|
||||
for (int i = 0; i < players.Count(); i++)
|
||||
{
|
||||
playerTimes[i] = 0.00000001f;
|
||||
playerTimesStr[i] = "DNF";
|
||||
playerTimesStr[i] = "0";
|
||||
}
|
||||
|
||||
DontDestroyOnLoad(gameObject);
|
||||
@@ -42,8 +42,6 @@ public class GameManager : MonoBehaviour
|
||||
// Update is called once per frame
|
||||
void Update()
|
||||
{
|
||||
print("playersfinished: " + playersFinished.Count());
|
||||
|
||||
for (int i = 0; i < players.Count(); i++)
|
||||
{
|
||||
GameObject player = players[i];
|
||||
@@ -121,6 +119,29 @@ public class GameManager : MonoBehaviour
|
||||
// race finished
|
||||
if (playersFinished.Count() == players.Count())
|
||||
{
|
||||
// sort array
|
||||
float[] fTimes = new float[players.Count()];
|
||||
|
||||
for (int i = 0; i < players.Count(); i++)
|
||||
{
|
||||
fTimes[i] = float.Parse(playerTimesStr[i]);
|
||||
}
|
||||
|
||||
Array.Sort(fTimes);
|
||||
|
||||
for (int i = 0; i < players.Count(); i++)
|
||||
{
|
||||
playerTimesStr[i] = fTimes[i].ToString();
|
||||
|
||||
try
|
||||
{
|
||||
playerTimesStr[i] = playerTimesStr[i].Substring(0, 7);
|
||||
}
|
||||
catch
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
SceneManager.LoadScene("WinScreen");
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user