From ef5c8e25a603690d83448e67c1f6801a3a7b2c68 Mon Sep 17 00:00:00 2001 From: magn9775 Date: Fri, 26 Apr 2024 18:21:02 +0200 Subject: [PATCH] DNF-timer + next car button when finished --- ...rePack_2020.3_HDRP_v1.24.unitypackage.meta | 7 - ...urePack_2020.3_URP_v1.24.unitypackage.meta | 7 - .../Timers/Car Customization_timers.json | 2 +- .../Timers/CityRacetrack_timers.json | 2 +- .../Timers/ForestRacetrack_timers.json | 2 +- .../Timers/Racetrack mini_timers.json | 14 +- Assets/ML-Agents/Timers/WinScreen_timers.json | 2 +- Assets/Prefabs/Driving UI.prefab | 552 +++++++++++++++++- Assets/Prefabs/GameManager.prefab | 53 +- Assets/Scenes/ForestRacetrack.unity | 240 +++----- Assets/Scripts/GameController.cs | 67 ++- Assets/Scripts/GameManager.cs | 27 +- 12 files changed, 736 insertions(+), 239 deletions(-) delete mode 100644 Assets/Imported Assets/SimpleNaturePack/SimpleNaturePack_2020.3_HDRP_v1.24.unitypackage.meta delete mode 100644 Assets/Imported Assets/SimpleNaturePack/SimpleNaturePack_2020.3_URP_v1.24.unitypackage.meta diff --git a/Assets/Imported Assets/SimpleNaturePack/SimpleNaturePack_2020.3_HDRP_v1.24.unitypackage.meta b/Assets/Imported Assets/SimpleNaturePack/SimpleNaturePack_2020.3_HDRP_v1.24.unitypackage.meta deleted file mode 100644 index 2f7eb2e..0000000 --- a/Assets/Imported Assets/SimpleNaturePack/SimpleNaturePack_2020.3_HDRP_v1.24.unitypackage.meta +++ /dev/null @@ -1,7 +0,0 @@ -fileFormatVersion: 2 -guid: 58f7e79a87c79824597746e8c1bfe400 -DefaultImporter: - externalObjects: {} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Imported Assets/SimpleNaturePack/SimpleNaturePack_2020.3_URP_v1.24.unitypackage.meta b/Assets/Imported Assets/SimpleNaturePack/SimpleNaturePack_2020.3_URP_v1.24.unitypackage.meta deleted file mode 100644 index 73c9a86..0000000 --- a/Assets/Imported Assets/SimpleNaturePack/SimpleNaturePack_2020.3_URP_v1.24.unitypackage.meta +++ /dev/null @@ -1,7 +0,0 @@ -fileFormatVersion: 2 -guid: f58d25b9e504a4f41ab4a71cf87c1845 -DefaultImporter: - externalObjects: {} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/ML-Agents/Timers/Car Customization_timers.json b/Assets/ML-Agents/Timers/Car Customization_timers.json index 0565b70..9c19d33 100644 --- a/Assets/ML-Agents/Timers/Car Customization_timers.json +++ b/Assets/ML-Agents/Timers/Car Customization_timers.json @@ -1 +1 @@ -{"count":1,"self":196.72761599999998,"total":218.7672601,"children":{"InitializeActuators":{"count":16,"self":0.0039921,"total":0.0039921,"children":null},"InitializeSensors":{"count":16,"self":0.001982,"total":0.001982,"children":null},"AgentSendState":{"count":10302,"self":1.67696,"total":2.0846375999999998,"children":{"CollectObservations":{"count":13904,"self":0.2781029,"total":0.2781029,"children":null},"WriteActionMask":{"count":13904,"self":0.0349994,"total":0.0349994,"children":null},"RequestDecision":{"count":13904,"self":0.0945753,"total":0.0945753,"children":null}}},"DecideAction":{"count":10302,"self":18.1721072,"total":18.4863648,"children":{"RayPerceptionSensor.Perceive":{"count":27808,"self":0.3142569,"total":0.3142569,"children":null}}},"AgentAct":{"count":10302,"self":1.4606668,"total":1.4606668,"children":null}},"gauges":{"Benson Track2.CumulativeReward":{"count":21,"max":25.5401878,"min":21.13704,"runningAverage":24.4067917,"value":25.3901539,"weightedAverage":24.80418}},"metadata":{"timer_format_version":"0.1.0","start_time_seconds":"1714138791","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":"Car Customization","end_time_seconds":"1714139010"}} \ No newline at end of file +{"count":1,"self":200.8249472,"total":207.0845853,"children":{"InitializeActuators":{"count":8,"self":0.0015941999999999998,"total":0.0015941999999999998,"children":null},"InitializeSensors":{"count":8,"self":0.0021820999999999998,"total":0.0021820999999999998,"children":null},"AgentSendState":{"count":10031,"self":0.5702967,"total":0.72402179999999994,"children":{"CollectObservations":{"count":10376,"self":0.093802,"total":0.093802,"children":null},"WriteActionMask":{"count":10376,"self":0.015859599999999998,"total":0.015859599999999998,"children":null},"RequestDecision":{"count":10376,"self":0.0440635,"total":0.0440635,"children":null}}},"DecideAction":{"count":10031,"self":4.9926156,"total":5.0748643,"children":{"RayPerceptionSensor.Perceive":{"count":20752,"self":0.0822488,"total":0.0822488,"children":null}}},"AgentAct":{"count":10031,"self":0.45597089999999996,"total":0.45597089999999996,"children":null}},"gauges":{"Benson Track2.CumulativeReward":{"count":15,"max":25.2713585,"min":15.4036465,"runningAverage":22.589819,"value":24.3716278,"weightedAverage":21.8500061}},"metadata":{"timer_format_version":"0.1.0","start_time_seconds":"1714146342","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\\UnityStuf\\Racesm -useHub -hubIPC -cloudEnvironment production -licensingIpc LicenseClient-Magnus -hubSessionId c6416c26-0d1f-4bb8-9e2e-4213b58881d9 -accessToken kB2tydvl5u9_B7IO-OpU7ZDe1h4aYXR8o12DYhlxdY8005f","communication_protocol_version":"1.5.0","com.unity.ml-agents_version":"2.0.1","scene_name":"Car Customization","end_time_seconds":"1714146549"}} \ No newline at end of file diff --git a/Assets/ML-Agents/Timers/CityRacetrack_timers.json b/Assets/ML-Agents/Timers/CityRacetrack_timers.json index 5d95a45..f67cce9 100644 --- a/Assets/ML-Agents/Timers/CityRacetrack_timers.json +++ b/Assets/ML-Agents/Timers/CityRacetrack_timers.json @@ -1 +1 @@ -{"count":1,"self":193.7252608,"total":201.3228297,"children":{"InitializeActuators":{"count":8,"self":0.0029833999999999998,"total":0.0029833999999999998,"children":null},"InitializeSensors":{"count":8,"self":0.0029920999999999997,"total":0.0029920999999999997,"children":null},"AgentSendState":{"count":9807,"self":1.1413769,"total":1.3504292999999998,"children":{"CollectObservations":{"count":15696,"self":0.1167665,"total":0.1167665,"children":null},"WriteActionMask":{"count":15696,"self":0.0360302,"total":0.0360302,"children":null},"RequestDecision":{"count":15696,"self":0.0562557,"total":0.0562557,"children":null}}},"DecideAction":{"count":9807,"self":5.5154011999999994,"total":5.6761821,"children":{"RayPerceptionSensor.Perceive":{"count":31392,"self":0.16078099999999998,"total":0.16078099999999998,"children":null}}},"AgentAct":{"count":9807,"self":0.56335249999999992,"total":0.56335249999999992,"children":null}},"gauges":{"Benson Track2.CumulativeReward":{"count":7,"max":26.7109566,"min":24.18585,"runningAverage":25.3461285,"value":26.7109566,"weightedAverage":25.4686451}},"metadata":{"timer_format_version":"0.1.0","start_time_seconds":"1714132015","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":"CityRacetrack","end_time_seconds":"1714132217"}} \ No newline at end of file +{"count":1,"self":11.586656,"total":11.7995491,"children":{"InitializeActuators":{"count":8,"self":0.0009991,"total":0.0009991,"children":null},"InitializeSensors":{"count":8,"self":0.0030226,"total":0.0030226,"children":null},"AgentSendState":{"count":363,"self":0.0209143,"total":0.037024299999999996,"children":{"CollectObservations":{"count":584,"self":0.0054928,"total":0.0054928,"children":null},"WriteActionMask":{"count":584,"self":0,"total":0,"children":null},"RequestDecision":{"count":584,"self":0.0106172,"total":0.0106172,"children":null}}},"DecideAction":{"count":363,"self":0.15195899999999998,"total":0.158469,"children":{"RayPerceptionSensor.Perceive":{"count":1168,"self":0.0065099999999999993,"total":0.0065099999999999993,"children":null}}},"AgentAct":{"count":363,"self":0.0123805,"total":0.0123805,"children":null}},"gauges":{},"metadata":{"timer_format_version":"0.1.0","start_time_seconds":"1714141846","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\\UnityStuf\\Racesm -useHub -hubIPC -cloudEnvironment production -licensingIpc LicenseClient-Magnus -hubSessionId c6416c26-0d1f-4bb8-9e2e-4213b58881d9 -accessToken kB2tydvl5u9_B7IO-OpU7ZDe1h4aYXR8o12DYhlxdY8005f","communication_protocol_version":"1.5.0","com.unity.ml-agents_version":"2.0.1","scene_name":"CityRacetrack","end_time_seconds":"1714141858"}} \ No newline at end of file diff --git a/Assets/ML-Agents/Timers/ForestRacetrack_timers.json b/Assets/ML-Agents/Timers/ForestRacetrack_timers.json index dd19ace..61a09d7 100644 --- a/Assets/ML-Agents/Timers/ForestRacetrack_timers.json +++ b/Assets/ML-Agents/Timers/ForestRacetrack_timers.json @@ -1 +1 @@ -{"count":1,"self":12.399459199999999,"total":13.293839499999999,"children":{"InitializeActuators":{"count":8,"self":0.0019879999999999997,"total":0.0019879999999999997,"children":null},"InitializeSensors":{"count":8,"self":0.0019944999999999997,"total":0.0019944999999999997,"children":null},"AgentSendState":{"count":416,"self":0.0657717,"total":0.092637299999999992,"children":{"CollectObservations":{"count":672,"self":0.011900299999999999,"total":0.011900299999999999,"children":null},"WriteActionMask":{"count":672,"self":0.00098559999999999989,"total":0.00098559999999999989,"children":null},"RequestDecision":{"count":672,"self":0.0139797,"total":0.0139797,"children":null}}},"DecideAction":{"count":416,"self":0.73920659999999994,"total":0.74924059999999992,"children":{"RayPerceptionSensor.Perceive":{"count":1344,"self":0.010034,"total":0.010034,"children":null}}},"AgentAct":{"count":416,"self":0.046527399999999997,"total":0.046527399999999997,"children":null}},"gauges":{},"metadata":{"timer_format_version":"0.1.0","start_time_seconds":"1714136963","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":"ForestRacetrack","end_time_seconds":"1714136976"}} \ No newline at end of file +{"count":1,"self":905.2292096,"total":911.8894275,"children":{"InitializeActuators":{"count":8,"self":0.0015029,"total":0.0015029,"children":null},"InitializeSensors":{"count":8,"self":0.0036747999999999998,"total":0.0036747999999999998,"children":null},"AgentSendState":{"count":7058,"self":0.56469989999999992,"total":0.725063,"children":{"CollectObservations":{"count":10816,"self":0.0998505,"total":0.0998505,"children":null},"WriteActionMask":{"count":10816,"self":0.0126071,"total":0.0126071,"children":null},"RequestDecision":{"count":10816,"self":0.0479055,"total":0.0479055,"children":null}}},"DecideAction":{"count":7058,"self":5.3450732,"total":5.4287874999999994,"children":{"RayPerceptionSensor.Perceive":{"count":21632,"self":0.0837142,"total":0.0837142,"children":null}}},"AgentAct":{"count":7058,"self":0.5011802,"total":0.5011802,"children":null}},"gauges":{"Benson Track2.CumulativeReward":{"count":14,"max":25.54358,"min":22.59286,"runningAverage":24.2738514,"value":25.37616,"weightedAverage":24.9011745}},"metadata":{"timer_format_version":"0.1.0","start_time_seconds":"1714146975","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\\UnityStuf\\Racesm -useHub -hubIPC -cloudEnvironment production -licensingIpc LicenseClient-Magnus -hubSessionId c6416c26-0d1f-4bb8-9e2e-4213b58881d9 -accessToken kB2tydvl5u9_B7IO-OpU7ZDe1h4aYXR8o12DYhlxdY8005f","communication_protocol_version":"1.5.0","com.unity.ml-agents_version":"2.0.1","scene_name":"ForestRacetrack","end_time_seconds":"1714147887"}} \ No newline at end of file diff --git a/Assets/ML-Agents/Timers/Racetrack mini_timers.json b/Assets/ML-Agents/Timers/Racetrack mini_timers.json index 5a3eee3..d9c58b8 100644 --- a/Assets/ML-Agents/Timers/Racetrack mini_timers.json +++ b/Assets/ML-Agents/Timers/Racetrack mini_timers.json @@ -1,13 +1 @@ -<<<<<<< HEAD -{"count":1,"self":130.6553984,"total":134.4493369,"children":{"InitializeActuators":{"count":8,"self":0.0010198,"total":0.0010198,"children":null},"InitializeSensors":{"count":8,"self":0.0030066999999999997,"total":0.0030066999999999997,"children":null},"AgentSendState":{"count":6496,"self":0.3408002,"total":0.42935599999999996,"children":{"CollectObservations":{"count":10400,"self":0.0540232,"total":0.0540232,"children":null},"WriteActionMask":{"count":10400,"self":0.0082496,"total":0.0082496,"children":null},"RequestDecision":{"count":10400,"self":0.026282999999999997,"total":0.026282999999999997,"children":null}}},"DecideAction":{"count":6496,"self":2.8975516,"total":2.9549209,"children":{"RayPerceptionSensor.Perceive":{"count":20800,"self":0.057369199999999995,"total":0.057369199999999995,"children":null}}},"AgentAct":{"count":6496,"self":0.4041279,"total":0.4041279,"children":null}},"gauges":{"Benson Track2.CumulativeReward":{"count":7,"max":24.5043068,"min":20.8994446,"runningAverage":22.6464348,"value":20.8994446,"weightedAverage":22.3884468}},"metadata":{"timer_format_version":"0.1.0","start_time_seconds":"1714118530","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":"Racetrack mini","end_time_seconds":"1714118664"}} -======= -<<<<<<< HEAD -{"count":1,"self":8.4118592,"total":8.6212582,"children":{"InitializeActuators":{"count":8,"self":0.0015846999999999999,"total":0.0015846999999999999,"children":null},"InitializeSensors":{"count":8,"self":0.0026517,"total":0.0026517,"children":null},"AgentSendState":{"count":165,"self":0.0284722,"total":0.0438079,"children":{"CollectObservations":{"count":264,"self":0.0020005,"total":0.0020005,"children":null},"WriteActionMask":{"count":264,"self":0.00051959999999999994,"total":0.00051959999999999994,"children":null},"RequestDecision":{"count":264,"self":0.0128156,"total":0.0128156,"children":null}}},"DecideAction":{"count":165,"self":0.1331645,"total":0.13570669999999999,"children":{"RayPerceptionSensor.Perceive":{"count":528,"self":0.0025421999999999997,"total":0.0025421999999999997,"children":null}}},"AgentAct":{"count":165,"self":0.0246146,"total":0.0246146,"children":null}},"gauges":{},"metadata":{"timer_format_version":"0.1.0","start_time_seconds":"1714115397","unity_version":"2022.3.11f1","command_line_arguments":"C:\\Program Files\\Unity\\Hub\\Editor\\2022.3.11f1\\Editor\\Unity.exe -projectpath C:\\Users\\hassa\\OneDrive\\Skrivebord\\alt pro\\Unity stuff\\Unity ting\\Racesm -useHub -hubIPC -cloudEnvironment production -licensingIpc LicenseClient-hassa -hubSessionId f8278c6f-053c-492d-a479-00a9dbf73437 -accessToken 1rPuSgTkgUUOXMaGthhixd2ZEngLQ-H31CETUrEqtzM005f","communication_protocol_version":"1.5.0","com.unity.ml-agents_version":"2.0.1","scene_name":"Racetrack mini","end_time_seconds":"1714115406"}} -======= -<<<<<<< HEAD -{"count":1,"self":52.366592,"total":53.0602252,"children":{"InitializeActuators":{"count":8,"self":0.001,"total":0.001,"children":null},"InitializeSensors":{"count":8,"self":0.0030047999999999997,"total":0.0030047999999999997,"children":null},"AgentSendState":{"count":2421,"self":0.1186515,"total":0.1531092,"children":{"CollectObservations":{"count":3880,"self":0.020620199999999998,"total":0.020620199999999998,"children":null},"WriteActionMask":{"count":3880,"self":0.0038607,"total":0.0038607,"children":null},"RequestDecision":{"count":3880,"self":0.0099768,"total":0.0099768,"children":null}}},"DecideAction":{"count":2421,"self":0.3727546,"total":0.38228779999999996,"children":{"RayPerceptionSensor.Perceive":{"count":7760,"self":0.0095332,"total":0.0095332,"children":null}}},"AgentAct":{"count":2421,"self":0.15323209999999998,"total":0.15323209999999998,"children":null}},"gauges":{"Benson Track2.CumulativeReward":{"count":1,"max":24.2250633,"min":24.2250633,"runningAverage":24.2250633,"value":24.2250633,"weightedAverage":24.2250633}},"metadata":{"timer_format_version":"0.1.0","start_time_seconds":"1714115875","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":"Racetrack mini","end_time_seconds":"1714115928"}} -======= -{"count":1,"self":77.2914176,"total":88.8739126,"children":{"InitializeActuators":{"count":8,"self":0.0059371,"total":0.0059371,"children":null},"InitializeSensors":{"count":8,"self":0.0019879,"total":0.0019879,"children":null},"AgentSendState":{"count":4180,"self":0.83452129999999991,"total":1.0729148,"children":{"CollectObservations":{"count":6688,"self":0.1623398,"total":0.1623398,"children":null},"WriteActionMask":{"count":6688,"self":0.0225535,"total":0.0225535,"children":null},"RequestDecision":{"count":6688,"self":0.0535002,"total":0.0535002,"children":null}}},"DecideAction":{"count":4180,"self":9.6043296,"total":9.7296031,"children":{"RayPerceptionSensor.Perceive":{"count":13376,"self":0.1252737,"total":0.1252737,"children":null}}},"AgentAct":{"count":4180,"self":0.7690629,"total":0.7690629,"children":null}},"gauges":{"Benson Track2.CumulativeReward":{"count":20,"max":25.1789246,"min":-0.826870739,"runningAverage":10.11593,"value":25.0408516,"weightedAverage":15.8942223}},"metadata":{"timer_format_version":"0.1.0","start_time_seconds":"1714115839","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":"Racetrack mini","end_time_seconds":"1714115927"}} ->>>>>>> d491c6dee7672d848b4f6de15eb4260fa3aef046 ->>>>>>> 55d93fe847a3f9f20fddf621f05aa62eaa6f0e48 ->>>>>>> 50c949f0cb8ee052c50c63755f03e263ce8efc2d +{"count":1,"self":260.8801792,"total":263.71180169999997,"children":{"InitializeActuators":{"count":2,"self":0.0012793,"total":0.0012793,"children":null},"InitializeSensors":{"count":2,"self":0.0020053,"total":0.0020053,"children":null},"AgentSendState":{"count":12917,"self":0.3768938,"total":0.4890713,"children":{"CollectObservations":{"count":5168,"self":0.058553799999999996,"total":0.058553799999999996,"children":null},"WriteActionMask":{"count":5168,"self":0.0059936999999999994,"total":0.0059936999999999994,"children":null},"RequestDecision":{"count":5168,"self":0.0429868,"total":0.04763,"children":{"RayPerceptionSensor.Perceive":{"count":5168,"self":0.0046432,"total":0.0046432,"children":null}}}}},"DecideAction":{"count":12917,"self":2.0233914,"total":2.0547198,"children":{"RayPerceptionSensor.Perceive":{"count":10336,"self":0.0313284,"total":0.0313284,"children":null}}},"AgentAct":{"count":12917,"self":0.2830542,"total":0.2830542,"children":null}},"gauges":{"BensonV7.CumulativeReward":{"count":1,"max":25.1733932,"min":25.1733932,"runningAverage":25.1733932,"value":25.1733932,"weightedAverage":25.1733932}},"metadata":{"timer_format_version":"0.1.0","start_time_seconds":"1713945905","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 985081e8-b814-4bc7-8736-608aea67ce7e -accessToken fMKSu_LeJtSMMwbIluJ0HvaiatLXHDxWic8X4MA6BEQ005f","communication_protocol_version":"1.5.0","com.unity.ml-agents_version":"2.0.1","scene_name":"Racetrack mini","end_time_seconds":"1713946168"}} diff --git a/Assets/ML-Agents/Timers/WinScreen_timers.json b/Assets/ML-Agents/Timers/WinScreen_timers.json index 9f44567..3e71f42 100644 --- a/Assets/ML-Agents/Timers/WinScreen_timers.json +++ b/Assets/ML-Agents/Timers/WinScreen_timers.json @@ -1 +1 @@ -{"count":1,"self":586.1533184,"total":643.4153359,"children":{"InitializeActuators":{"count":24,"self":0.0030404,"total":0.0030404,"children":null},"InitializeSensors":{"count":24,"self":0.0029801,"total":0.0029801,"children":null},"AgentSendState":{"count":31266,"self":4.3217256,"total":5.4124117,"children":{"CollectObservations":{"count":35184,"self":0.70932549999999994,"total":0.70932549999999994,"children":null},"WriteActionMask":{"count":35184,"self":0.10799389999999999,"total":0.10799389999999999,"children":null},"RequestDecision":{"count":35184,"self":0.2733665,"total":0.2733665,"children":null}}},"DecideAction":{"count":31266,"self":47.4672,"total":48.2260843,"children":{"RayPerceptionSensor.Perceive":{"count":70368,"self":0.75888329999999993,"total":0.75888329999999993,"children":null}}},"AgentAct":{"count":31266,"self":3.6145072,"total":3.6145072999999996,"children":null}},"gauges":{"Benson Track2.CumulativeReward":{"count":49,"max":25.5646172,"min":7.690056,"runningAverage":23.0404053,"value":24.91241,"weightedAverage":24.5779648}},"metadata":{"timer_format_version":"0.1.0","start_time_seconds":"1714139265","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":"1714139908"}} \ No newline at end of file +{"count":1,"self":168.6765696,"total":175.33775029999998,"children":{"InitializeActuators":{"count":8,"self":0.0015029,"total":0.0015029,"children":null},"InitializeSensors":{"count":8,"self":0.0036747999999999998,"total":0.0036747999999999998,"children":null},"AgentSendState":{"count":7058,"self":0.56469989999999992,"total":0.725063,"children":{"CollectObservations":{"count":10816,"self":0.0998505,"total":0.0998505,"children":null},"WriteActionMask":{"count":10816,"self":0.0126071,"total":0.0126071,"children":null},"RequestDecision":{"count":10816,"self":0.0479055,"total":0.0479055,"children":null}}},"DecideAction":{"count":7058,"self":5.3450732,"total":5.4287874999999994,"children":{"RayPerceptionSensor.Perceive":{"count":21632,"self":0.0837142,"total":0.0837142,"children":null}}},"AgentAct":{"count":7058,"self":0.5011802,"total":0.5011802,"children":null}},"gauges":{"Benson Track2.CumulativeReward":{"count":14,"max":25.54358,"min":22.59286,"runningAverage":24.2738514,"value":25.37616,"weightedAverage":24.9011745}},"metadata":{"timer_format_version":"0.1.0","start_time_seconds":"1714146975","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\\UnityStuf\\Racesm -useHub -hubIPC -cloudEnvironment production -licensingIpc LicenseClient-Magnus -hubSessionId c6416c26-0d1f-4bb8-9e2e-4213b58881d9 -accessToken kB2tydvl5u9_B7IO-OpU7ZDe1h4aYXR8o12DYhlxdY8005f","communication_protocol_version":"1.5.0","com.unity.ml-agents_version":"2.0.1","scene_name":"WinScreen","end_time_seconds":"1714147150"}} \ No newline at end of file diff --git a/Assets/Prefabs/Driving UI.prefab b/Assets/Prefabs/Driving UI.prefab index 475f800..b2b92e0 100644 --- a/Assets/Prefabs/Driving UI.prefab +++ b/Assets/Prefabs/Driving UI.prefab @@ -1,5 +1,139 @@ %YAML 1.1 %TAG !u! tag:unity3d.com,2011: +--- !u!1 &402042887614084384 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 6636506657744911434} + - component: {fileID: 1975417162710887817} + - component: {fileID: 7657207629190035690} + m_Layer: 5 + m_Name: startTimer + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &6636506657744911434 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 402042887614084384} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 6591880210688179092} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0.5, y: 0.5} + m_AnchorMax: {x: 0.5, y: 0.5} + m_AnchoredPosition: {x: 0, y: 0} + m_SizeDelta: {x: 1000, y: 500} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!222 &1975417162710887817 +CanvasRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 402042887614084384} + m_CullTransparentMesh: 1 +--- !u!114 &7657207629190035690 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 402042887614084384} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: f4688fdb7df04437aeb418b961361dc5, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Material: {fileID: 0} + m_Color: {r: 1, g: 1, b: 1, a: 1} + m_RaycastTarget: 1 + m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0} + m_Maskable: 1 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_text: 3 + m_isRightToLeft: 0 + m_fontAsset: {fileID: 11400000, guid: 8f586378b4e144a9851e7b34d9b748ee, type: 2} + m_sharedMaterial: {fileID: 2180264, guid: 8f586378b4e144a9851e7b34d9b748ee, type: 2} + m_fontSharedMaterials: [] + m_fontMaterial: {fileID: 0} + m_fontMaterials: [] + m_fontColor32: + serializedVersion: 2 + rgba: 4294967295 + m_fontColor: {r: 1, g: 1, b: 1, a: 1} + m_enableVertexGradient: 0 + m_colorMode: 3 + m_fontColorGradient: + topLeft: {r: 1, g: 1, b: 1, a: 1} + topRight: {r: 1, g: 1, b: 1, a: 1} + bottomLeft: {r: 1, g: 1, b: 1, a: 1} + bottomRight: {r: 1, g: 1, b: 1, a: 1} + m_fontColorGradientPreset: {fileID: 0} + m_spriteAsset: {fileID: 0} + m_tintAllSprites: 0 + m_StyleSheet: {fileID: 0} + m_TextStyleHashCode: -1183493901 + m_overrideHtmlColors: 0 + m_faceColor: + serializedVersion: 2 + rgba: 4294967295 + m_fontSize: 100 + m_fontSizeBase: 100 + m_fontWeight: 400 + m_enableAutoSizing: 0 + m_fontSizeMin: 18 + m_fontSizeMax: 72 + m_fontStyle: 1 + m_HorizontalAlignment: 2 + m_VerticalAlignment: 512 + m_textAlignment: 65535 + m_characterSpacing: 0 + m_wordSpacing: 0 + m_lineSpacing: 0 + m_lineSpacingMax: 0 + m_paragraphSpacing: 0 + m_charWidthMaxAdj: 0 + m_enableWordWrapping: 1 + m_wordWrappingRatios: 0.4 + m_overflowMode: 0 + m_linkedTextComponent: {fileID: 0} + parentLinkedComponent: {fileID: 0} + m_enableKerning: 1 + m_enableExtraPadding: 0 + checkPaddingRequired: 0 + m_isRichText: 1 + m_parseCtrlCharacters: 1 + m_isOrthographic: 1 + m_isCullingEnabled: 0 + m_horizontalMapping: 0 + m_verticalMapping: 0 + m_uvLineOffset: 0 + m_geometrySortingOrder: 0 + m_IsTextObjectScaleStatic: 0 + m_VertexBufferAutoSizeReduction: 0 + m_useMaxVisibleDescender: 1 + m_pageToDisplay: 1 + m_margin: {x: 0, y: 0, z: 0, w: -143.84424} + m_isUsingLegacyAnimationComponent: 0 + m_isVolumetricText: 0 + m_hasFontAssetChanged: 0 + m_baseMaterial: {fileID: 0} + m_maskOffset: {x: 0, y: 0, z: 0, w: 0} --- !u!1 &2249422870405817347 GameObject: m_ObjectHideFlags: 0 @@ -65,7 +199,141 @@ MonoBehaviour: m_OnCullStateChanged: m_PersistentCalls: m_Calls: [] - m_text: 'Lap count: 1/1' + m_text: 'Lap count: 1/3' + m_isRightToLeft: 0 + m_fontAsset: {fileID: 11400000, guid: 8f586378b4e144a9851e7b34d9b748ee, type: 2} + m_sharedMaterial: {fileID: 2180264, guid: 8f586378b4e144a9851e7b34d9b748ee, type: 2} + m_fontSharedMaterials: [] + m_fontMaterial: {fileID: 0} + m_fontMaterials: [] + m_fontColor32: + serializedVersion: 2 + rgba: 4294967295 + m_fontColor: {r: 1, g: 1, b: 1, a: 1} + m_enableVertexGradient: 0 + m_colorMode: 3 + m_fontColorGradient: + topLeft: {r: 1, g: 1, b: 1, a: 1} + topRight: {r: 1, g: 1, b: 1, a: 1} + bottomLeft: {r: 1, g: 1, b: 1, a: 1} + bottomRight: {r: 1, g: 1, b: 1, a: 1} + m_fontColorGradientPreset: {fileID: 0} + m_spriteAsset: {fileID: 0} + m_tintAllSprites: 0 + m_StyleSheet: {fileID: 0} + m_TextStyleHashCode: -1183493901 + m_overrideHtmlColors: 0 + m_faceColor: + serializedVersion: 2 + rgba: 4294967295 + m_fontSize: 45 + m_fontSizeBase: 45 + m_fontWeight: 400 + m_enableAutoSizing: 0 + m_fontSizeMin: 18 + m_fontSizeMax: 72 + m_fontStyle: 1 + m_HorizontalAlignment: 1 + m_VerticalAlignment: 256 + m_textAlignment: 65535 + m_characterSpacing: 0 + m_wordSpacing: 0 + m_lineSpacing: 0 + m_lineSpacingMax: 0 + m_paragraphSpacing: 0 + m_charWidthMaxAdj: 0 + m_enableWordWrapping: 1 + m_wordWrappingRatios: 0.4 + m_overflowMode: 0 + m_linkedTextComponent: {fileID: 0} + parentLinkedComponent: {fileID: 0} + m_enableKerning: 1 + m_enableExtraPadding: 0 + checkPaddingRequired: 0 + m_isRichText: 1 + m_parseCtrlCharacters: 1 + m_isOrthographic: 1 + m_isCullingEnabled: 0 + m_horizontalMapping: 0 + m_verticalMapping: 0 + m_uvLineOffset: 0 + m_geometrySortingOrder: 0 + m_IsTextObjectScaleStatic: 0 + m_VertexBufferAutoSizeReduction: 0 + m_useMaxVisibleDescender: 1 + m_pageToDisplay: 1 + m_margin: {x: 0, y: 0, z: 0, w: 0} + m_isUsingLegacyAnimationComponent: 0 + m_isVolumetricText: 0 + m_hasFontAssetChanged: 0 + m_baseMaterial: {fileID: 0} + m_maskOffset: {x: 0, y: 0, z: 0, w: 0} +--- !u!1 &2394325268247018758 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1862320999672514362} + - component: {fileID: 8692966575303831509} + - component: {fileID: 2742502550092546725} + m_Layer: 5 + m_Name: DNFTime + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &1862320999672514362 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 2394325268247018758} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 6591880210688179092} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0.5, y: 0.5} + m_AnchorMax: {x: 0.5, y: 0.5} + m_AnchoredPosition: {x: -655.91, y: 340.2} + m_SizeDelta: {x: 508.17, y: 68.9229} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!222 &8692966575303831509 +CanvasRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 2394325268247018758} + m_CullTransparentMesh: 1 +--- !u!114 &2742502550092546725 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 2394325268247018758} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: f4688fdb7df04437aeb418b961361dc5, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Material: {fileID: 0} + m_Color: {r: 1, g: 1, b: 1, a: 1} + m_RaycastTarget: 1 + m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0} + m_Maskable: 1 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_text: 'DNF Timer: 0' m_isRightToLeft: 0 m_fontAsset: {fileID: 11400000, guid: 8f586378b4e144a9851e7b34d9b748ee, type: 2} m_sharedMaterial: {fileID: 2180264, guid: 8f586378b4e144a9851e7b34d9b748ee, type: 2} @@ -301,6 +569,9 @@ RectTransform: m_Children: - {fileID: 8518173326926186102} - {fileID: 4473337556744181764} + - {fileID: 1862320999672514362} + - {fileID: 6636506657744911434} + - {fileID: 921006781256657926} m_Father: {fileID: 0} m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_AnchorMin: {x: 0, y: 0} @@ -371,3 +642,282 @@ MonoBehaviour: m_BlockingMask: serializedVersion: 2 m_Bits: 4294967295 +--- !u!1 &5715023284740291791 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 921006781256657926} + - component: {fileID: 90759790161954031} + - component: {fileID: 1219362737876935348} + - component: {fileID: 710581762558348017} + m_Layer: 5 + m_Name: Play + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &921006781256657926 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 5715023284740291791} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: + - {fileID: 2424452537470208699} + m_Father: {fileID: 6591880210688179092} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 1, y: 1} + m_AnchorMax: {x: 1, y: 1} + m_AnchoredPosition: {x: -175, y: -75} + m_SizeDelta: {x: 300, y: 100} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!222 &90759790161954031 +CanvasRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 5715023284740291791} + m_CullTransparentMesh: 1 +--- !u!114 &1219362737876935348 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 5715023284740291791} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: fe87c0e1cc204ed48ad3b37840f39efc, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Material: {fileID: 0} + m_Color: {r: 0, g: 0.6631899, b: 0.8509804, a: 1} + m_RaycastTarget: 1 + m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0} + m_Maskable: 1 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_Sprite: {fileID: 21300000, guid: 61583fba956632548911dbe60ba47876, type: 3} + m_Type: 1 + m_PreserveAspect: 0 + m_FillCenter: 1 + m_FillMethod: 4 + m_FillAmount: 1 + m_FillClockwise: 1 + m_FillOrigin: 0 + m_UseSpriteMesh: 0 + m_PixelsPerUnitMultiplier: 1 +--- !u!114 &710581762558348017 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 5715023284740291791} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 4e29b1a8efbd4b44bb3f3716e73f07ff, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Navigation: + m_Mode: 3 + m_WrapAround: 0 + m_SelectOnUp: {fileID: 0} + m_SelectOnDown: {fileID: 0} + m_SelectOnLeft: {fileID: 0} + m_SelectOnRight: {fileID: 0} + m_Transition: 1 + m_Colors: + m_NormalColor: {r: 1, g: 1, b: 1, a: 1} + m_HighlightedColor: {r: 0.045523323, g: 0.62803227, b: 0.8773585, a: 1} + m_PressedColor: {r: 0.78431374, g: 0.78431374, b: 0.78431374, a: 1} + m_SelectedColor: {r: 0.9607843, g: 0.9607843, b: 0.9607843, a: 1} + m_DisabledColor: {r: 0.78431374, g: 0.78431374, b: 0.78431374, a: 0.5019608} + m_ColorMultiplier: 1 + m_FadeDuration: 0.1 + m_SpriteState: + m_HighlightedSprite: {fileID: 0} + m_PressedSprite: {fileID: 0} + m_SelectedSprite: {fileID: 0} + m_DisabledSprite: {fileID: 0} + m_AnimationTriggers: + m_NormalTrigger: Normal + m_HighlightedTrigger: Highlighted + m_PressedTrigger: Pressed + m_SelectedTrigger: Selected + m_DisabledTrigger: Disabled + m_Interactable: 1 + m_TargetGraphic: {fileID: 1219362737876935348} + m_OnClick: + m_PersistentCalls: + m_Calls: + - m_Target: {fileID: 0} + m_TargetAssemblyTypeName: TimeOfDay, Assembly-CSharp + m_MethodName: SetTimeOfDay + m_Mode: 1 + m_Arguments: + m_ObjectArgument: {fileID: 0} + m_ObjectArgumentAssemblyTypeName: UnityEngine.Object, UnityEngine + m_IntArgument: 0 + m_FloatArgument: 0 + m_StringArgument: + m_BoolArgument: 0 + m_CallState: 2 + - m_Target: {fileID: 0} + m_TargetAssemblyTypeName: MapSelectorScript, Assembly-CSharp + m_MethodName: SelectMapAndLoadScene + m_Mode: 1 + m_Arguments: + m_ObjectArgument: {fileID: 0} + m_ObjectArgumentAssemblyTypeName: UnityEngine.Object, UnityEngine + m_IntArgument: 0 + m_FloatArgument: 0 + m_StringArgument: + m_BoolArgument: 0 + m_CallState: 2 +--- !u!1 &6154853013793137455 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 2424452537470208699} + - component: {fileID: 5199694492735990822} + - component: {fileID: 445662412832947446} + m_Layer: 5 + m_Name: Text (TMP) + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &2424452537470208699 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 6154853013793137455} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 921006781256657926} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0, y: 0} + m_AnchorMax: {x: 1, y: 1} + m_AnchoredPosition: {x: 0, y: 0} + m_SizeDelta: {x: 0, y: 0} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!222 &5199694492735990822 +CanvasRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 6154853013793137455} + m_CullTransparentMesh: 1 +--- !u!114 &445662412832947446 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 6154853013793137455} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: f4688fdb7df04437aeb418b961361dc5, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Material: {fileID: 0} + m_Color: {r: 1, g: 1, b: 1, a: 1} + m_RaycastTarget: 1 + m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0} + m_Maskable: 1 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_text: Next Car (N) + m_isRightToLeft: 0 + m_fontAsset: {fileID: 11400000, guid: 8f586378b4e144a9851e7b34d9b748ee, type: 2} + m_sharedMaterial: {fileID: 2180264, guid: 8f586378b4e144a9851e7b34d9b748ee, type: 2} + m_fontSharedMaterials: [] + m_fontMaterial: {fileID: 0} + m_fontMaterials: [] + m_fontColor32: + serializedVersion: 2 + rgba: 4281479730 + m_fontColor: {r: 0.19607843, g: 0.19607843, b: 0.19607843, a: 1} + m_enableVertexGradient: 0 + m_colorMode: 3 + m_fontColorGradient: + topLeft: {r: 1, g: 1, b: 1, a: 1} + topRight: {r: 1, g: 1, b: 1, a: 1} + bottomLeft: {r: 1, g: 1, b: 1, a: 1} + bottomRight: {r: 1, g: 1, b: 1, a: 1} + m_fontColorGradientPreset: {fileID: 0} + m_spriteAsset: {fileID: 0} + m_tintAllSprites: 0 + m_StyleSheet: {fileID: 0} + m_TextStyleHashCode: -1183493901 + m_overrideHtmlColors: 0 + m_faceColor: + serializedVersion: 2 + rgba: 4294967295 + m_fontSize: 40 + m_fontSizeBase: 40 + m_fontWeight: 400 + m_enableAutoSizing: 0 + m_fontSizeMin: 18 + m_fontSizeMax: 72 + m_fontStyle: 1 + m_HorizontalAlignment: 2 + m_VerticalAlignment: 512 + m_textAlignment: 65535 + m_characterSpacing: 0 + m_wordSpacing: 0 + m_lineSpacing: 0 + m_lineSpacingMax: 0 + m_paragraphSpacing: 0 + m_charWidthMaxAdj: 0 + m_enableWordWrapping: 1 + m_wordWrappingRatios: 0.4 + m_overflowMode: 0 + m_linkedTextComponent: {fileID: 0} + parentLinkedComponent: {fileID: 0} + m_enableKerning: 1 + m_enableExtraPadding: 0 + checkPaddingRequired: 0 + m_isRichText: 1 + m_parseCtrlCharacters: 1 + m_isOrthographic: 1 + m_isCullingEnabled: 0 + m_horizontalMapping: 0 + m_verticalMapping: 0 + m_uvLineOffset: 0 + m_geometrySortingOrder: 0 + m_IsTextObjectScaleStatic: 0 + m_VertexBufferAutoSizeReduction: 0 + m_useMaxVisibleDescender: 1 + m_pageToDisplay: 1 + m_margin: {x: 0, y: 0, z: 0, w: 0} + m_isUsingLegacyAnimationComponent: 0 + m_isVolumetricText: 0 + m_hasFontAssetChanged: 0 + m_baseMaterial: {fileID: 0} + m_maskOffset: {x: 0, y: 0, z: 0, w: 0} diff --git a/Assets/Prefabs/GameManager.prefab b/Assets/Prefabs/GameManager.prefab index cda068c..a17283d 100644 --- a/Assets/Prefabs/GameManager.prefab +++ b/Assets/Prefabs/GameManager.prefab @@ -50,6 +50,11 @@ MonoBehaviour: - {fileID: 0} - {fileID: 0} - {fileID: 0} + - {fileID: 0} + - {fileID: 0} + - {fileID: 0} + - {fileID: 0} + - {fileID: 0} Colors: - {fileID: 2100000, guid: aa4a216a2af73e349a061c3b08f04fca, type: 2} - {fileID: 2100000, guid: 6519c0a548fad8541a36cb66f9201d08, type: 2} @@ -77,9 +82,41 @@ MonoBehaviour: m_Script: {fileID: 11500000, guid: 4ad347dab55166f40a93601eb1733707, type: 3} m_Name: m_EditorClassIdentifier: - lapAmount: 0 - checkpoints: [] - players: [] + lapAmount: 3 + checkpoints: + - {fileID: 0} + - {fileID: 0} + - {fileID: 0} + - {fileID: 0} + - {fileID: 0} + - {fileID: 0} + - {fileID: 0} + - {fileID: 0} + - {fileID: 0} + - {fileID: 0} + - {fileID: 0} + - {fileID: 0} + - {fileID: 0} + - {fileID: 0} + - {fileID: 0} + - {fileID: 0} + players: + - {fileID: 0} + - {fileID: 0} + - {fileID: 0} + - {fileID: 0} + - {fileID: 0} + - {fileID: 0} + - {fileID: 0} + - {fileID: 0} + playersFinished: [] + playerTimes: [] + playerTimesStr: [] + lapCounter: {fileID: 0} + timeCounter: {fileID: 0} + startTime: {fileID: 0} + DNFTime: {fileID: 0} + nextCarbtn: {fileID: 0} --- !u!114 &5539949921570205737 MonoBehaviour: m_ObjectHideFlags: 0 @@ -95,3 +132,13 @@ MonoBehaviour: NextCarKey: 110 NextCarButton: {fileID: 0} PlayerCar: {fileID: 0} + cam: {fileID: 0} + cars: + - {fileID: 0} + - {fileID: 0} + - {fileID: 0} + - {fileID: 0} + - {fileID: 0} + - {fileID: 0} + - {fileID: 0} + - {fileID: 0} diff --git a/Assets/Scenes/ForestRacetrack.unity b/Assets/Scenes/ForestRacetrack.unity index 3b36245..5eecf94 100644 --- a/Assets/Scenes/ForestRacetrack.unity +++ b/Assets/Scenes/ForestRacetrack.unity @@ -621,140 +621,17 @@ Transform: - {fileID: 1577072443} m_Father: {fileID: 0} m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} ---- !u!1 &341842529 -GameObject: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - serializedVersion: 6 - m_Component: - - component: {fileID: 341842530} - - component: {fileID: 341842532} - - component: {fileID: 341842531} - m_Layer: 5 - m_Name: startTimer - m_TagString: Untagged - m_Icon: {fileID: 0} - m_NavMeshLayer: 0 - m_StaticEditorFlags: 0 - m_IsActive: 1 ---- !u!224 &341842530 -RectTransform: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 341842529} - m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} - m_LocalPosition: {x: 0, y: 0, z: 0} - m_LocalScale: {x: 1, y: 1, z: 1} - m_ConstrainProportionsScale: 0 - m_Children: [] - m_Father: {fileID: 4459975215774235059} - m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} - m_AnchorMin: {x: 0.5, y: 0.5} - m_AnchorMax: {x: 0.5, y: 0.5} - m_AnchoredPosition: {x: 0, y: 0} - m_SizeDelta: {x: 1000, y: 500} - m_Pivot: {x: 0.5, y: 0.5} ---- !u!114 &341842531 +--- !u!114 &341842531 stripped MonoBehaviour: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} + m_CorrespondingSourceObject: {fileID: 7657207629190035690, guid: ad34455a014250446a5073260803b0a0, type: 3} + m_PrefabInstance: {fileID: 4459975215774235058} m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 341842529} + m_GameObject: {fileID: 0} m_Enabled: 1 m_EditorHideFlags: 0 m_Script: {fileID: 11500000, guid: f4688fdb7df04437aeb418b961361dc5, type: 3} m_Name: m_EditorClassIdentifier: - m_Material: {fileID: 0} - m_Color: {r: 1, g: 1, b: 1, a: 1} - m_RaycastTarget: 1 - m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0} - m_Maskable: 1 - m_OnCullStateChanged: - m_PersistentCalls: - m_Calls: [] - m_text: 3 - m_isRightToLeft: 0 - m_fontAsset: {fileID: 11400000, guid: 8f586378b4e144a9851e7b34d9b748ee, type: 2} - m_sharedMaterial: {fileID: 2180264, guid: 8f586378b4e144a9851e7b34d9b748ee, type: 2} - m_fontSharedMaterials: [] - m_fontMaterial: {fileID: 0} - m_fontMaterials: [] - m_fontColor32: - serializedVersion: 2 - rgba: 4294967295 - m_fontColor: {r: 1, g: 1, b: 1, a: 1} - m_enableVertexGradient: 0 - m_colorMode: 3 - m_fontColorGradient: - topLeft: {r: 1, g: 1, b: 1, a: 1} - topRight: {r: 1, g: 1, b: 1, a: 1} - bottomLeft: {r: 1, g: 1, b: 1, a: 1} - bottomRight: {r: 1, g: 1, b: 1, a: 1} - m_fontColorGradientPreset: {fileID: 0} - m_spriteAsset: {fileID: 0} - m_tintAllSprites: 0 - m_StyleSheet: {fileID: 0} - m_TextStyleHashCode: -1183493901 - m_overrideHtmlColors: 0 - m_faceColor: - serializedVersion: 2 - rgba: 4294967295 - m_fontSize: 100 - m_fontSizeBase: 100 - m_fontWeight: 400 - m_enableAutoSizing: 0 - m_fontSizeMin: 18 - m_fontSizeMax: 72 - m_fontStyle: 1 - m_HorizontalAlignment: 2 - m_VerticalAlignment: 512 - m_textAlignment: 65535 - m_characterSpacing: 0 - m_wordSpacing: 0 - m_lineSpacing: 0 - m_lineSpacingMax: 0 - m_paragraphSpacing: 0 - m_charWidthMaxAdj: 0 - m_enableWordWrapping: 1 - m_wordWrappingRatios: 0.4 - m_overflowMode: 0 - m_linkedTextComponent: {fileID: 0} - parentLinkedComponent: {fileID: 0} - m_enableKerning: 1 - m_enableExtraPadding: 0 - checkPaddingRequired: 0 - m_isRichText: 1 - m_parseCtrlCharacters: 1 - m_isOrthographic: 1 - m_isCullingEnabled: 0 - m_horizontalMapping: 0 - m_verticalMapping: 0 - m_uvLineOffset: 0 - m_geometrySortingOrder: 0 - m_IsTextObjectScaleStatic: 0 - m_VertexBufferAutoSizeReduction: 0 - m_useMaxVisibleDescender: 1 - m_pageToDisplay: 1 - m_margin: {x: 0, y: 0, z: 0, w: -143.84424} - m_isUsingLegacyAnimationComponent: 0 - m_isVolumetricText: 0 - m_hasFontAssetChanged: 0 - m_baseMaterial: {fileID: 0} - m_maskOffset: {x: 0, y: 0, z: 0, w: 0} ---- !u!222 &341842532 -CanvasRenderer: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 341842529} - m_CullTransparentMesh: 1 --- !u!1001 &352239913 PrefabInstance: m_ObjectHideFlags: 0 @@ -1378,11 +1255,27 @@ PrefabInstance: m_AddedGameObjects: [] m_AddedComponents: [] m_SourcePrefab: {fileID: 100100000, guid: 9a80cc25f1296554a92f05347d4a024e, type: 3} +--- !u!1 &546571954 stripped +GameObject: + m_CorrespondingSourceObject: {fileID: 5715023284740291791, guid: ad34455a014250446a5073260803b0a0, type: 3} + m_PrefabInstance: {fileID: 4459975215774235058} + m_PrefabAsset: {fileID: 0} --- !u!1 &556260502 stripped GameObject: m_CorrespondingSourceObject: {fileID: 820120218557562435, guid: dc3e6243ce610df4c845a9fa5df754a7, type: 3} m_PrefabInstance: {fileID: 8684226825208193988} m_PrefabAsset: {fileID: 0} +--- !u!114 &556260503 stripped +MonoBehaviour: + m_CorrespondingSourceObject: {fileID: 5539949921570205737, guid: dc3e6243ce610df4c845a9fa5df754a7, type: 3} + m_PrefabInstance: {fileID: 8684226825208193988} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 556260502} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: b00fe924fac7ccc488443310caf9e5b9, type: 3} + m_Name: + m_EditorClassIdentifier: --- !u!4 &559703698 stripped Transform: m_CorrespondingSourceObject: {fileID: 43625883235569613, guid: 8e14ccd68551a1a4e93b83808515b996, type: 3} @@ -5464,6 +5357,17 @@ MonoBehaviour: m_Script: {fileID: 11500000, guid: f4688fdb7df04437aeb418b961361dc5, type: 3} m_Name: m_EditorClassIdentifier: +--- !u!114 &2001879719 stripped +MonoBehaviour: + m_CorrespondingSourceObject: {fileID: 2742502550092546725, guid: ad34455a014250446a5073260803b0a0, type: 3} + m_PrefabInstance: {fileID: 4459975215774235058} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: f4688fdb7df04437aeb418b961361dc5, type: 3} + m_Name: + m_EditorClassIdentifier: --- !u!1001 &2015774333 PrefabInstance: m_ObjectHideFlags: 0 @@ -5866,13 +5770,53 @@ PrefabInstance: serializedVersion: 3 m_TransformParent: {fileID: 0} m_Modifications: + - target: {fileID: 710581762558348017, guid: ad34455a014250446a5073260803b0a0, type: 3} + propertyPath: m_OnClick.m_PersistentCalls.m_Calls.Array.size + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 710581762558348017, guid: ad34455a014250446a5073260803b0a0, type: 3} + propertyPath: m_OnClick.m_PersistentCalls.m_Calls.Array.data[0].m_Mode + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 710581762558348017, guid: ad34455a014250446a5073260803b0a0, type: 3} + propertyPath: m_OnClick.m_PersistentCalls.m_Calls.Array.data[0].m_Target + value: + objectReference: {fileID: 556260503} + - target: {fileID: 710581762558348017, guid: ad34455a014250446a5073260803b0a0, type: 3} + propertyPath: m_OnClick.m_PersistentCalls.m_Calls.Array.data[1].m_Target + value: + objectReference: {fileID: 11500000, guid: b00fe924fac7ccc488443310caf9e5b9, type: 3} + - target: {fileID: 710581762558348017, guid: ad34455a014250446a5073260803b0a0, type: 3} + propertyPath: m_OnClick.m_PersistentCalls.m_Calls.Array.data[0].m_CallState + value: 2 + objectReference: {fileID: 0} + - target: {fileID: 710581762558348017, guid: ad34455a014250446a5073260803b0a0, type: 3} + propertyPath: m_OnClick.m_PersistentCalls.m_Calls.Array.data[0].m_MethodName + value: NextCar + objectReference: {fileID: 0} + - target: {fileID: 710581762558348017, guid: ad34455a014250446a5073260803b0a0, type: 3} + propertyPath: m_OnClick.m_PersistentCalls.m_Calls.Array.data[1].m_MethodName + value: + objectReference: {fileID: 0} + - target: {fileID: 710581762558348017, guid: ad34455a014250446a5073260803b0a0, type: 3} + propertyPath: m_OnClick.m_PersistentCalls.m_Calls.Array.data[0].m_TargetAssemblyTypeName + value: GameController, Assembly-CSharp + objectReference: {fileID: 0} + - target: {fileID: 710581762558348017, guid: ad34455a014250446a5073260803b0a0, type: 3} + propertyPath: m_OnClick.m_PersistentCalls.m_Calls.Array.data[0].m_Arguments.m_StringArgument + value: + objectReference: {fileID: 0} + - target: {fileID: 710581762558348017, guid: ad34455a014250446a5073260803b0a0, type: 3} + propertyPath: m_OnClick.m_PersistentCalls.m_Calls.Array.data[0].m_Arguments.m_ObjectArgumentAssemblyTypeName + value: UnityEngine.Object, UnityEngine + objectReference: {fileID: 0} - target: {fileID: 4015923860507804037, guid: ad34455a014250446a5073260803b0a0, type: 3} propertyPath: m_Name value: Driving UI objectReference: {fileID: 0} - - target: {fileID: 4583573475034773881, guid: ad34455a014250446a5073260803b0a0, type: 3} - propertyPath: m_text - value: 'Lap count: 1/3' + - target: {fileID: 5715023284740291791, guid: ad34455a014250446a5073260803b0a0, type: 3} + propertyPath: m_IsActive + value: 0 objectReference: {fileID: 0} - target: {fileID: 6591880210688179092, guid: ad34455a014250446a5073260803b0a0, type: 3} propertyPath: m_Pivot.x @@ -5956,17 +5900,9 @@ PrefabInstance: objectReference: {fileID: 0} m_RemovedComponents: [] m_RemovedGameObjects: [] - m_AddedGameObjects: - - targetCorrespondingSourceObject: {fileID: 6591880210688179092, guid: ad34455a014250446a5073260803b0a0, type: 3} - insertIndex: -1 - addedObject: {fileID: 341842530} + m_AddedGameObjects: [] m_AddedComponents: [] m_SourcePrefab: {fileID: 100100000, guid: ad34455a014250446a5073260803b0a0, type: 3} ---- !u!224 &4459975215774235059 stripped -RectTransform: - m_CorrespondingSourceObject: {fileID: 6591880210688179092, guid: ad34455a014250446a5073260803b0a0, type: 3} - m_PrefabInstance: {fileID: 4459975215774235058} - m_PrefabAsset: {fileID: 0} --- !u!1001 &8684226825208193988 PrefabInstance: m_ObjectHideFlags: 0 @@ -6027,10 +5963,6 @@ PrefabInstance: propertyPath: targetcar value: objectReference: {fileID: 1373860110} - - target: {fileID: 4615150776958234185, guid: dc3e6243ce610df4c845a9fa5df754a7, type: 3} - propertyPath: Cars.Array.size - value: 8 - objectReference: {fileID: 0} - target: {fileID: 4615150776958234185, guid: dc3e6243ce610df4c845a9fa5df754a7, type: 3} propertyPath: Cars.Array.data[0] value: @@ -6064,9 +5996,9 @@ PrefabInstance: value: objectReference: {fileID: 1373860105} - target: {fileID: 5365138393421743302, guid: dc3e6243ce610df4c845a9fa5df754a7, type: 3} - propertyPath: lapAmount - value: 3 - objectReference: {fileID: 0} + propertyPath: DNFTime + value: + objectReference: {fileID: 2001879719} - target: {fileID: 5365138393421743302, guid: dc3e6243ce610df4c845a9fa5df754a7, type: 3} propertyPath: startTime value: @@ -6075,14 +6007,14 @@ PrefabInstance: propertyPath: lapCounter value: objectReference: {fileID: 1885205886} + - target: {fileID: 5365138393421743302, guid: dc3e6243ce610df4c845a9fa5df754a7, type: 3} + propertyPath: nextCarbtn + value: + objectReference: {fileID: 546571954} - target: {fileID: 5365138393421743302, guid: dc3e6243ce610df4c845a9fa5df754a7, type: 3} propertyPath: timeCounter value: objectReference: {fileID: 1986611068} - - target: {fileID: 5365138393421743302, guid: dc3e6243ce610df4c845a9fa5df754a7, type: 3} - propertyPath: players.Array.size - value: 8 - objectReference: {fileID: 0} - target: {fileID: 5365138393421743302, guid: dc3e6243ce610df4c845a9fa5df754a7, type: 3} propertyPath: players.Array.data[0] value: @@ -6115,10 +6047,6 @@ PrefabInstance: propertyPath: players.Array.data[7] value: objectReference: {fileID: 1373860105} - - target: {fileID: 5365138393421743302, guid: dc3e6243ce610df4c845a9fa5df754a7, type: 3} - propertyPath: checkpoints.Array.size - value: 16 - objectReference: {fileID: 0} - target: {fileID: 5365138393421743302, guid: dc3e6243ce610df4c845a9fa5df754a7, type: 3} propertyPath: checkpoints.Array.data[0] value: @@ -6191,10 +6119,6 @@ PrefabInstance: propertyPath: PlayerCar value: objectReference: {fileID: 1373860110} - - target: {fileID: 5539949921570205737, guid: dc3e6243ce610df4c845a9fa5df754a7, type: 3} - propertyPath: cars.Array.size - value: 8 - objectReference: {fileID: 0} - target: {fileID: 5539949921570205737, guid: dc3e6243ce610df4c845a9fa5df754a7, type: 3} propertyPath: cars.Array.data[0] value: diff --git a/Assets/Scripts/GameController.cs b/Assets/Scripts/GameController.cs index 8273a77..3e6c9d6 100644 --- a/Assets/Scripts/GameController.cs +++ b/Assets/Scripts/GameController.cs @@ -17,58 +17,55 @@ public class GameController :MonoBehaviour public static bool RaceIsStarted { get { return true; } } public static bool RaceIsEnded { get { return false; } } - //PlayerController m_PlayerCar; - //List Cars = new List(); + public TextMeshPro speedometer; + public List cars; int CurrentCarIndex = 0; - protected virtual void Awake () + + private List finished; + + void Start() { - - Instance = this; + finished=gameObject.GetComponent().playersFinished; - // foreach (var car in cars) - // { - // var userControl = car.GetComponent(); - // var audioListener = car.GetComponent(); - - // if (userControl == null) - // { - // userControl = car.gameObject.AddComponent (); - // } - - // if (audioListener == null) - // { - // audioListener = car.gameObject.AddComponent (); - // } - - // userControl.enabled = false; - // audioListener.enabled = false; - // } - - - // cars[CurrentCarIndex].GetComponent().enabled = true; - // cars[CurrentCarIndex].GetComponent().enabled = true; + if (speedometer == null) + { + speedometer = new TextMeshPro(); + } + if (carRB == null) + { + carRB = GetComponent(); + } } - void Update () + public void Update () { + if (Input.GetKeyDown (NextCarKey)) { NextCar (); } + carVel = (math.abs(carRB.velocity.x) + math.abs(carRB.velocity.y) + math.abs(carRB.velocity.z))*5; + //print(carVel); + speedometer.SetText(carVel.ToString()); + } - private void NextCar () + public void NextCar() { - // cars[CurrentCarIndex].GetComponent ().enabled = false; - // cars[CurrentCarIndex].GetComponent ().enabled = false; + for (int i = 0; i < cars.Count; i++) + { + if (finished.Contains(cars[i].name)) + { + cars.Remove(cars[i]); + } + } CurrentCarIndex = LoopClamp (CurrentCarIndex + 1, 0, cars.Count); - - // cars[CurrentCarIndex].GetComponent().enabled = true; - // cars[CurrentCarIndex].GetComponent().enabled = true; + + PlayerCar = cars[CurrentCarIndex]; @@ -90,4 +87,6 @@ public class GameController :MonoBehaviour } return value; } + + } diff --git a/Assets/Scripts/GameManager.cs b/Assets/Scripts/GameManager.cs index 2966d11..fa6b899 100644 --- a/Assets/Scripts/GameManager.cs +++ b/Assets/Scripts/GameManager.cs @@ -8,6 +8,7 @@ using UnityEditor.SearchService; using UnityEngine; using UnityEngine.SceneManagement; + public class GameManager : MonoBehaviour { public int lapAmount; @@ -20,6 +21,9 @@ public class GameManager : MonoBehaviour public TextMeshProUGUI lapCounter; public TextMeshProUGUI timeCounter; public TextMeshProUGUI startTime; + public TextMeshProUGUI DNFTime; + public TextMeshProUGUI speedometer; + public GameObject nextCarbtn; float DNFTimer = 0; private bool hasCountedDown = false; void Start() @@ -51,6 +55,10 @@ public class GameManager : MonoBehaviour StartGame(); } + + + + for (int i = 0; i < players.Count(); i++) { GameObject player = players[i]; @@ -86,6 +94,10 @@ public class GameManager : MonoBehaviour { int checkpointsCollected = player.GetComponent().checkpointsCollected; + carRB = player.GetComponent(); + carVel = (math.abs(carRB.velocity.x) + math.abs(carRB.velocity.y) + math.abs(carRB.velocity.z))*5; + speedometer.SetText(carVel.ToString()); + if (checkpointsCollected == checkpoints.Count()) { player.GetComponent().checkpointsCollected = 0; @@ -96,18 +108,7 @@ public class GameManager : MonoBehaviour lapCounter.text = "Lap count: " + playerLaps[i] + "/" + lapAmount; } - string strTimes =playerTimes[i].ToString(); - - int seconds = (int)MathF.Floor(playerTimes[i]); - int seperator = strTimes.IndexOf(","); - string miliseconds; - - if (strTimes.Length < seperator + 4) - miliseconds = ",000"; - else - miliseconds = strTimes.Substring(seperator, 4); - - timeCounter.text = "Time: " + seconds + miliseconds; + timeCounter.text = "Time: " + (Mathf.Round(playerTimes[i]*1000)/1000).ToString(); } if (playerLaps[i] > lapAmount) @@ -120,6 +121,7 @@ public class GameManager : MonoBehaviour else playersFinished.Add(player.name + " (player)"); player.GetComponent().enabled = false; + nextCarbtn.SetActive(true); playerTimesStr[i] = playerTimes[i].ToString(); } @@ -131,6 +133,7 @@ public class GameManager : MonoBehaviour if (playersFinished.Count() > 0) { DNFTimer += Time.deltaTime; + DNFTime.text = "DNF timer: "+(Mathf.Round(60-DNFTimer)).ToString(); } // race finished