From 3b9ef2ad1b63f7af04747f3c255f40d1b76de729 Mon Sep 17 00:00:00 2001 From: Ciakon Date: Fri, 26 Apr 2024 10:25:23 +0200 Subject: [PATCH] fixed background music --- .../Timers/ForestRacetrack_timers.json | 2 +- .../Timers/ForestRacetrack_timers.json.meta | 7 + Assets/ML-Agents/Timers/WinScreen_timers.json | 2 +- Assets/Scenes/Car Customization.unity | 196 +++++++++--------- Assets/Scenes/Map selector.unity | 11 +- .../Map Selector Script.cs | 2 + 6 files changed, 120 insertions(+), 100 deletions(-) create mode 100644 Assets/ML-Agents/Timers/ForestRacetrack_timers.json.meta diff --git a/Assets/ML-Agents/Timers/ForestRacetrack_timers.json b/Assets/ML-Agents/Timers/ForestRacetrack_timers.json index a4d7d21..4cbef97 100644 --- a/Assets/ML-Agents/Timers/ForestRacetrack_timers.json +++ b/Assets/ML-Agents/Timers/ForestRacetrack_timers.json @@ -1 +1 @@ -{"count":1,"self":21.5131744,"total":23.13593,"children":{"InitializeActuators":{"count":8,"self":0.0025478,"total":0.0025478,"children":null},"InitializeSensors":{"count":8,"self":0.0029984,"total":0.0029984,"children":null},"AgentSendState":{"count":909,"self":0.13680989999999998,"total":0.1972582,"children":{"CollectObservations":{"count":1456,"self":0.031240499999999997,"total":0.031240499999999997,"children":null},"WriteActionMask":{"count":1456,"self":0.0027826,"total":0.0027826,"children":null},"RequestDecision":{"count":1456,"self":0.0264252,"total":0.0264252,"children":null}}},"DecideAction":{"count":909,"self":1.2634709,"total":1.28315,"children":{"RayPerceptionSensor.Perceive":{"count":2912,"self":0.019679099999999998,"total":0.019679099999999998,"children":null}}},"AgentAct":{"count":909,"self":0.1368018,"total":0.1368018,"children":null}},"gauges":{},"metadata":{"timer_format_version":"0.1.0","start_time_seconds":"1714118759","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":"ForestRacetrack","end_time_seconds":"1714118782"}} \ No newline at end of file +{"count":1,"self":10.229835999999999,"total":10.539707,"children":{"InitializeActuators":{"count":8,"self":0.0015033,"total":0.0015033,"children":null},"InitializeSensors":{"count":8,"self":0.0015321,"total":0.0015321,"children":null},"AgentSendState":{"count":302,"self":0.025935299999999998,"total":0.0560955,"children":{"CollectObservations":{"count":488,"self":0.0060285,"total":0.0060285,"children":null},"WriteActionMask":{"count":488,"self":0,"total":0,"children":null},"RequestDecision":{"count":488,"self":0.0241317,"total":0.0241317,"children":null}}},"DecideAction":{"count":302,"self":0.22161319999999998,"total":0.2252556,"children":{"RayPerceptionSensor.Perceive":{"count":976,"self":0.0036423999999999996,"total":0.0036423999999999996,"children":null}}},"AgentAct":{"count":302,"self":0.0239814,"total":0.0239814,"children":null}},"gauges":{},"metadata":{"timer_format_version":"0.1.0","start_time_seconds":"1714119859","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":"ForestRacetrack","end_time_seconds":"1714119870"}} \ No newline at end of file diff --git a/Assets/ML-Agents/Timers/ForestRacetrack_timers.json.meta b/Assets/ML-Agents/Timers/ForestRacetrack_timers.json.meta new file mode 100644 index 0000000..f4c9ef6 --- /dev/null +++ b/Assets/ML-Agents/Timers/ForestRacetrack_timers.json.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: d8bb5515cee0b6a4eb5b45eb46ece700 +TextScriptImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/ML-Agents/Timers/WinScreen_timers.json b/Assets/ML-Agents/Timers/WinScreen_timers.json index 69645b5..5cd69f6 100644 --- a/Assets/ML-Agents/Timers/WinScreen_timers.json +++ b/Assets/ML-Agents/Timers/WinScreen_timers.json @@ -1 +1 @@ -{"count":1,"self":133.2106368,"total":136.1075323,"children":{"InitializeActuators":{"count":8,"self":0.0010054,"total":0.0010054,"children":null},"InitializeSensors":{"count":8,"self":0.0010002,"total":0.0010002,"children":null},"AgentSendState":{"count":4854,"self":0.2595425,"total":0.3360959,"children":{"CollectObservations":{"count":7768,"self":0.039823399999999995,"total":0.039823399999999995,"children":null},"WriteActionMask":{"count":7768,"self":0.0065368,"total":0.0065368,"children":null},"RequestDecision":{"count":7768,"self":0.0301932,"total":0.0301932,"children":null}}},"DecideAction":{"count":4854,"self":2.1690815999999997,"total":2.2024192,"children":{"RayPerceptionSensor.Perceive":{"count":15536,"self":0.0333376,"total":0.0333376,"children":null}}},"AgentAct":{"count":4854,"self":0.35185829999999996,"total":0.35185829999999996,"children":null}},"gauges":{"Benson Track2.CumulativeReward":{"count":4,"max":24.915411,"min":15.8891373,"runningAverage":22.56735,"value":15.8891373,"weightedAverage":22.5912132}},"metadata":{"timer_format_version":"0.1.0","start_time_seconds":"1714117940","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":"1714118076"}} \ No newline at end of file +{"count":1,"self":495.4255872,"total":498.2974708,"children":{"InitializeActuators":{"count":8,"self":0,"total":0,"children":null},"InitializeSensors":{"count":8,"self":0.0020004,"total":0.0020004,"children":null},"AgentSendState":{"count":4757,"self":0.289884,"total":0.3578125,"children":{"CollectObservations":{"count":7616,"self":0.035282299999999996,"total":0.035282299999999996,"children":null},"WriteActionMask":{"count":7616,"self":0.0061163,"total":0.0061163,"children":null},"RequestDecision":{"count":7616,"self":0.0265299,"total":0.0265299,"children":null}}},"DecideAction":{"count":4757,"self":2.1771583999999997,"total":2.227519,"children":{"RayPerceptionSensor.Perceive":{"count":15232,"self":0.050360699999999994,"total":0.050360699999999994,"children":null}}},"AgentAct":{"count":4757,"self":0.28455169999999996,"total":0.28455169999999996,"children":null}},"gauges":{"Benson Track2.CumulativeReward":{"count":7,"max":25.4703846,"min":20.7829914,"runningAverage":23.9274235,"value":21.1050835,"weightedAverage":23.3504276}},"metadata":{"timer_format_version":"0.1.0","start_time_seconds":"1714118972","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":"1714119471"}} \ No newline at end of file diff --git a/Assets/Scenes/Car Customization.unity b/Assets/Scenes/Car Customization.unity index 778b480..d4b0b43 100644 --- a/Assets/Scenes/Car Customization.unity +++ b/Assets/Scenes/Car Customization.unity @@ -1250,7 +1250,6 @@ GameObject: m_Component: - component: {fileID: 481224846} - component: {fileID: 481224847} - - component: {fileID: 481224849} - component: {fileID: 481224848} m_Layer: 0 m_Name: Main garage @@ -1358,102 +1357,6 @@ AudioListener: m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 481224845} m_Enabled: 1 ---- !u!82 &481224849 -AudioSource: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 481224845} - m_Enabled: 1 - serializedVersion: 4 - OutputAudioMixerGroup: {fileID: 0} - m_audioClip: {fileID: 8300000, guid: 10cae2fd52e1c0f4eba2e2091d441cd1, type: 3} - m_PlayOnAwake: 1 - m_Volume: 1 - m_Pitch: 1 - Loop: 1 - Mute: 0 - Spatialize: 0 - SpatializePostEffects: 0 - Priority: 128 - DopplerLevel: 1 - MinDistance: 1 - MaxDistance: 500 - Pan2D: 0 - rolloffMode: 0 - BypassEffects: 0 - BypassListenerEffects: 0 - BypassReverbZones: 0 - rolloffCustomCurve: - serializedVersion: 2 - m_Curve: - - serializedVersion: 3 - time: 0 - value: 1 - inSlope: 0 - outSlope: 0 - tangentMode: 0 - weightedMode: 0 - inWeight: 0.33333334 - outWeight: 0.33333334 - - serializedVersion: 3 - time: 1 - value: 0 - inSlope: 0 - outSlope: 0 - tangentMode: 0 - weightedMode: 0 - inWeight: 0.33333334 - outWeight: 0.33333334 - m_PreInfinity: 2 - m_PostInfinity: 2 - m_RotationOrder: 4 - panLevelCustomCurve: - serializedVersion: 2 - m_Curve: - - serializedVersion: 3 - time: 0 - value: 0 - inSlope: 0 - outSlope: 0 - tangentMode: 0 - weightedMode: 0 - inWeight: 0.33333334 - outWeight: 0.33333334 - m_PreInfinity: 2 - m_PostInfinity: 2 - m_RotationOrder: 4 - spreadCustomCurve: - serializedVersion: 2 - m_Curve: - - serializedVersion: 3 - time: 0 - value: 0 - inSlope: 0 - outSlope: 0 - tangentMode: 0 - weightedMode: 0 - inWeight: 0.33333334 - outWeight: 0.33333334 - m_PreInfinity: 2 - m_PostInfinity: 2 - m_RotationOrder: 4 - reverbZoneMixCustomCurve: - serializedVersion: 2 - m_Curve: - - serializedVersion: 3 - time: 0 - value: 1 - inSlope: 0 - outSlope: 0 - tangentMode: 0 - weightedMode: 0 - inWeight: 0.33333334 - outWeight: 0.33333334 - m_PreInfinity: 2 - m_PostInfinity: 2 - m_RotationOrder: 4 --- !u!1 &535753315 GameObject: m_ObjectHideFlags: 0 @@ -1748,6 +1651,9 @@ PrefabInstance: - targetCorrespondingSourceObject: {fileID: 820120218557562435, guid: dc3e6243ce610df4c845a9fa5df754a7, type: 3} insertIndex: -1 addedObject: {fileID: 1607325866} + - targetCorrespondingSourceObject: {fileID: 820120218557562435, guid: dc3e6243ce610df4c845a9fa5df754a7, type: 3} + insertIndex: -1 + addedObject: {fileID: 1607325868} m_SourcePrefab: {fileID: 100100000, guid: dc3e6243ce610df4c845a9fa5df754a7, type: 3} --- !u!1001 &727592024 PrefabInstance: @@ -4694,6 +4600,102 @@ MonoBehaviour: m_EditorClassIdentifier: carType: carColor: +--- !u!82 &1607325868 +AudioSource: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1607325861} + m_Enabled: 1 + serializedVersion: 4 + OutputAudioMixerGroup: {fileID: 0} + m_audioClip: {fileID: 8300000, guid: 10cae2fd52e1c0f4eba2e2091d441cd1, type: 3} + m_PlayOnAwake: 1 + m_Volume: 1 + m_Pitch: 1 + Loop: 1 + Mute: 0 + Spatialize: 0 + SpatializePostEffects: 0 + Priority: 128 + DopplerLevel: 1 + MinDistance: 1 + MaxDistance: 500 + Pan2D: 0 + rolloffMode: 0 + BypassEffects: 0 + BypassListenerEffects: 0 + BypassReverbZones: 0 + rolloffCustomCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + panLevelCustomCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + spreadCustomCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + reverbZoneMixCustomCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 --- !u!1 &1671445827 GameObject: m_ObjectHideFlags: 0 diff --git a/Assets/Scenes/Map selector.unity b/Assets/Scenes/Map selector.unity index db60485..75c77ce 100644 --- a/Assets/Scenes/Map selector.unity +++ b/Assets/Scenes/Map selector.unity @@ -38,7 +38,7 @@ RenderSettings: m_ReflectionIntensity: 1 m_CustomReflection: {fileID: 0} m_Sun: {fileID: 0} - m_IndirectSpecularColor: {r: 0.4482451, g: 0.49827182, b: 0.57558125, a: 1} + m_IndirectSpecularColor: {r: 0.4482453, g: 0.49827206, b: 0.5755818, a: 1} m_UseRadianceAmbientProbe: 0 --- !u!157 &3 LightmapSettings: @@ -1604,6 +1604,7 @@ GameObject: serializedVersion: 6 m_Component: - component: {fileID: 841402787} + - component: {fileID: 841402788} m_Layer: 0 m_Name: CameraRotator m_TagString: Untagged @@ -1627,6 +1628,14 @@ Transform: - {fileID: 333991148} m_Father: {fileID: 0} m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!81 &841402788 +AudioListener: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 841402786} + m_Enabled: 1 --- !u!4 &845470139 stripped Transform: m_CorrespondingSourceObject: {fileID: 1828470746108631247, guid: bb42b7aaa687b2f4d811c8cc5d2d259f, type: 3} diff --git a/Assets/Scripts/map selector script/Map Selector Script.cs b/Assets/Scripts/map selector script/Map Selector Script.cs index a1bcb83..7ea12e7 100644 --- a/Assets/Scripts/map selector script/Map Selector Script.cs +++ b/Assets/Scripts/map selector script/Map Selector Script.cs @@ -53,6 +53,8 @@ public class MapSelectorScript : MonoBehaviour public void SelectMapAndLoadScene() { + AudioSource backgroundMusic = GameObject.Find("Car Data").GetComponent(); + backgroundMusic.Stop(); SceneManager.LoadScene(scene); } }