Merge branch 'master' of ooftooft.net:Racesm

This commit is contained in:
2024-04-26 13:00:20 +02:00
2 changed files with 48 additions and 52 deletions

View File

@@ -1 +1 @@
{"count":1,"self":199.1533184,"total":218.8379795,"children":{"InitializeActuators":{"count":8,"self":0.0019921,"total":0.0019921,"children":null},"InitializeSensors":{"count":8,"self":0.0030242999999999997,"total":0.0030242999999999997,"children":null},"AgentSendState":{"count":10664,"self":1.5327274,"total":1.9015727,"children":{"CollectObservations":{"count":12680,"self":0.2323625,"total":0.2323625,"children":null},"WriteActionMask":{"count":12680,"self":0.046358899999999995,"total":0.046358899999999995,"children":null},"RequestDecision":{"count":12680,"self":0.090123899999999993,"total":0.090123899999999993,"children":null}}},"DecideAction":{"count":10664,"self":16.3909248,"total":16.650102999999998,"children":{"RayPerceptionSensor.Perceive":{"count":25360,"self":0.2591788,"total":0.2591788,"children":null}}},"AgentAct":{"count":10664,"self":1.1259698,"total":1.1259698,"children":null}},"gauges":{"Benson Track2.CumulativeReward":{"count":21,"max":25.5732841,"min":19.9673977,"runningAverage":24.3276081,"value":25.3809662,"weightedAverage":25.0823269}},"metadata":{"timer_format_version":"0.1.0","start_time_seconds":"1714127324","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":"1714127543"}} {"count":1,"self":170.6430464,"total":189.0146734,"children":{"InitializeActuators":{"count":8,"self":0.0019992,"total":0.0019992,"children":null},"InitializeSensors":{"count":8,"self":0.0019935,"total":0.0019935,"children":null},"AgentSendState":{"count":9173,"self":1.4745792,"total":1.8214966,"children":{"CollectObservations":{"count":11896,"self":0.2234861,"total":0.2234861,"children":null},"WriteActionMask":{"count":11896,"self":0.0479707,"total":0.0479707,"children":null},"RequestDecision":{"count":11896,"self":0.0754606,"total":0.0754606,"children":null}}},"DecideAction":{"count":9173,"self":15.2346224,"total":15.4989647,"children":{"RayPerceptionSensor.Perceive":{"count":23792,"self":0.26434189999999996,"total":0.26434189999999996,"children":null}}},"AgentAct":{"count":9173,"self":1.0441208,"total":1.0441208,"children":null}},"gauges":{"Benson Track2.CumulativeReward":{"count":21,"max":25.6625557,"min":21.0153389,"runningAverage":24.2349434,"value":25.34607,"weightedAverage":25.0115242}},"metadata":{"timer_format_version":"0.1.0","start_time_seconds":"1714128643","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":"1714128832"}}

View File

@@ -20,8 +20,10 @@ public class WinScript : MonoBehaviour
carGarage.SetActive(false); carGarage.SetActive(false);
} }
leaderboard = GameObject.Find("GameManager").GetComponent<GameManager>().playersFinished; leaderboard = GameObject.Find("GameManager").GetComponent<GameManager>().playersFinished;
time = GameObject.Find("GameManager").GetComponent<GameManager>().playerTimes; time = GameObject.Find("GameManager").GetComponent<GameManager>().playerTimesSTR;
if (leaderboard[0].Contains("Player")){
Garages[0].SetActive(true);
}else{
if (leaderboard[0] == "Racecar") if (leaderboard[0] == "Racecar")
{ {
currentGarage = Garages[6]; currentGarage = Garages[6];
@@ -62,14 +64,7 @@ public class WinScript : MonoBehaviour
currentGarage = Garages[0]; currentGarage = Garages[0];
Garages[0].SetActive(true); Garages[0].SetActive(true);
} }
} }
private void Update()
{
MainText.text = "Leaderboard: "; MainText.text = "Leaderboard: ";
MainText2.text = "Time: "; MainText2.text = "Time: ";
for (var i = 0; i < leaderboard.Count; i++){ for (var i = 0; i < leaderboard.Count; i++){
@@ -79,6 +74,7 @@ public class WinScript : MonoBehaviour
} }
private void FixedUpdate() { private void FixedUpdate() {
currentGarage.transform.eulerAngles += Vector3.up * 0.7f; currentGarage.transform.eulerAngles += Vector3.up * 0.7f;
//currentRotation = CurrentCar.transform.rotation; //currentRotation = CurrentCar.transform.rotation;