From 294701f69aa2cd0a6160f8bbc2f710ac2b00d691 Mon Sep 17 00:00:00 2001 From: ntr Date: Tue, 26 Sep 2023 20:37:15 +1000 Subject: [PATCH] ok ok --- Assets/Audio/Accelerate.wav | 3 + ...{MenuHigh.wav.meta => Accelerate.wav.meta} | 2 +- Assets/Audio/Boost-1.wav | 3 + .../{MenuLow.wav.meta => Boost-1.wav.meta} | 2 +- Assets/Audio/Boost-2.wav | 3 + Assets/Audio/Boost-2.wav.meta | 23 +++ Assets/Audio/Decelerate.wav | 3 + Assets/Audio/Decelerate.wav.meta | 23 +++ Assets/Audio/MenuHigh.wav | 3 - Assets/Audio/MenuLow.wav | 3 - Assets/Audio/Strafe.wav | 3 + Assets/Audio/Strafe.wav.meta | 23 +++ Assets/Prefabs/Ship/Ship.prefab | 59 ++++++ Assets/Resources/URPAsset.asset | 0 Assets/Scenes/sr_junglism2.unity | 34 ++-- Assets/Scenes/sr_silverstorage.unity | 46 ++++- Assets/Src/Audio.cs | 56 ------ Assets/Src/ShipAudio.cs | 183 ++++++++++++++++++ .../Src/{Audio.cs.meta => ShipAudio.cs.meta} | 2 +- Assets/Src/ShipControls.cs | 4 + Assets/Src/UI/MenuControls.cs | 2 +- Packages/packages-lock.json | 2 +- ProjectSettings/ProjectSettings.asset | 13 +- ProjectSettings/VFXManager.asset | 2 +- 24 files changed, 407 insertions(+), 90 deletions(-) create mode 100755 Assets/Audio/Accelerate.wav rename Assets/Audio/{MenuHigh.wav.meta => Accelerate.wav.meta} (91%) create mode 100755 Assets/Audio/Boost-1.wav rename Assets/Audio/{MenuLow.wav.meta => Boost-1.wav.meta} (91%) create mode 100755 Assets/Audio/Boost-2.wav create mode 100755 Assets/Audio/Boost-2.wav.meta create mode 100755 Assets/Audio/Decelerate.wav create mode 100755 Assets/Audio/Decelerate.wav.meta delete mode 100755 Assets/Audio/MenuHigh.wav delete mode 100755 Assets/Audio/MenuLow.wav create mode 100755 Assets/Audio/Strafe.wav create mode 100755 Assets/Audio/Strafe.wav.meta mode change 100644 => 100755 Assets/Resources/URPAsset.asset mode change 100644 => 100755 Assets/Scenes/sr_junglism2.unity mode change 100644 => 100755 Assets/Scenes/sr_silverstorage.unity delete mode 100755 Assets/Src/Audio.cs create mode 100755 Assets/Src/ShipAudio.cs rename Assets/Src/{Audio.cs.meta => ShipAudio.cs.meta} (83%) mode change 100644 => 100755 ProjectSettings/ProjectSettings.asset mode change 100644 => 100755 ProjectSettings/VFXManager.asset diff --git a/Assets/Audio/Accelerate.wav b/Assets/Audio/Accelerate.wav new file mode 100755 index 0000000..ebe38c5 --- /dev/null +++ b/Assets/Audio/Accelerate.wav @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:bc075a81ef80ea493c3e913eec8e47bd1fc18775692f3f5f6ccdc8f4450f63d1 +size 210988 diff --git a/Assets/Audio/MenuHigh.wav.meta b/Assets/Audio/Accelerate.wav.meta similarity index 91% rename from Assets/Audio/MenuHigh.wav.meta rename to Assets/Audio/Accelerate.wav.meta index 45ccfea..d29d6d4 100755 --- a/Assets/Audio/MenuHigh.wav.meta +++ b/Assets/Audio/Accelerate.wav.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: 10a4e1180cb3be54da0d7d98dd327c8c +guid: 613e0b85af271854f9d89cb48db1445b AudioImporter: externalObjects: {} serializedVersion: 7 diff --git a/Assets/Audio/Boost-1.wav b/Assets/Audio/Boost-1.wav new file mode 100755 index 0000000..af4d2d5 --- /dev/null +++ b/Assets/Audio/Boost-1.wav @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:17663071d7867c318e6f2d1494094b798436399e7e2b7443264030ad893e1dfb +size 1411244 diff --git a/Assets/Audio/MenuLow.wav.meta b/Assets/Audio/Boost-1.wav.meta similarity index 91% rename from Assets/Audio/MenuLow.wav.meta rename to Assets/Audio/Boost-1.wav.meta index 7fa9c8c..44b9deb 100755 --- a/Assets/Audio/MenuLow.wav.meta +++ b/Assets/Audio/Boost-1.wav.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: 1cdd6e27104267647b16db497f41744f +guid: f5e946c296766694b97892f7386e533e AudioImporter: externalObjects: {} serializedVersion: 7 diff --git a/Assets/Audio/Boost-2.wav b/Assets/Audio/Boost-2.wav new file mode 100755 index 0000000..1a535ac --- /dev/null +++ b/Assets/Audio/Boost-2.wav @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:d7659663580bba8c49e12f2193626a34f8d40864249a51fc0539c74edfb44c66 +size 1411244 diff --git a/Assets/Audio/Boost-2.wav.meta b/Assets/Audio/Boost-2.wav.meta new file mode 100755 index 0000000..5c77e7d --- /dev/null +++ b/Assets/Audio/Boost-2.wav.meta @@ -0,0 +1,23 @@ +fileFormatVersion: 2 +guid: 4ba402be6dacb3340a1c791560c97b97 +AudioImporter: + externalObjects: {} + serializedVersion: 7 + defaultSettings: + serializedVersion: 2 + loadType: 0 + sampleRateSetting: 0 + sampleRateOverride: 44100 + compressionFormat: 1 + quality: 1 + conversionMode: 0 + preloadAudioData: 0 + platformSettingOverrides: {} + forceToMono: 0 + normalize: 1 + loadInBackground: 0 + ambisonic: 0 + 3D: 1 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Audio/Decelerate.wav b/Assets/Audio/Decelerate.wav new file mode 100755 index 0000000..bd6a280 --- /dev/null +++ b/Assets/Audio/Decelerate.wav @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:673a54435dc9e583a62a1606ca32647be564d44c8951ab7c3e2744d86dd71f21 +size 427964 diff --git a/Assets/Audio/Decelerate.wav.meta b/Assets/Audio/Decelerate.wav.meta new file mode 100755 index 0000000..b8d56a6 --- /dev/null +++ b/Assets/Audio/Decelerate.wav.meta @@ -0,0 +1,23 @@ +fileFormatVersion: 2 +guid: 0384b39259118674781276c265b83dec +AudioImporter: + externalObjects: {} + serializedVersion: 7 + defaultSettings: + serializedVersion: 2 + loadType: 0 + sampleRateSetting: 0 + sampleRateOverride: 44100 + compressionFormat: 1 + quality: 1 + conversionMode: 0 + preloadAudioData: 0 + platformSettingOverrides: {} + forceToMono: 0 + normalize: 1 + loadInBackground: 0 + ambisonic: 0 + 3D: 1 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Audio/MenuHigh.wav b/Assets/Audio/MenuHigh.wav deleted file mode 100755 index 61d2ff8..0000000 --- a/Assets/Audio/MenuHigh.wav +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:49a453239d940b0f4e86f46c23c4fd77740fdf10f2fd0eb7a5fcf72d56229344 -size 1411244 diff --git a/Assets/Audio/MenuLow.wav b/Assets/Audio/MenuLow.wav deleted file mode 100755 index 0d56eff..0000000 --- a/Assets/Audio/MenuLow.wav +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:0f7d857dc0f784214e924676d4a5c916f3c2621660b0f83193d08f5167b1687a -size 1411244 diff --git a/Assets/Audio/Strafe.wav b/Assets/Audio/Strafe.wav new file mode 100755 index 0000000..98a3f1a --- /dev/null +++ b/Assets/Audio/Strafe.wav @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:ce1995ebcf201e3d1e7eb28c661ebe8739a1532ed982cc2af441f2521bfa8812 +size 338268 diff --git a/Assets/Audio/Strafe.wav.meta b/Assets/Audio/Strafe.wav.meta new file mode 100755 index 0000000..d27d1bb --- /dev/null +++ b/Assets/Audio/Strafe.wav.meta @@ -0,0 +1,23 @@ +fileFormatVersion: 2 +guid: b34b1ec00bb1ba643afcdc88ea960e06 +AudioImporter: + externalObjects: {} + serializedVersion: 7 + defaultSettings: + serializedVersion: 2 + loadType: 0 + sampleRateSetting: 0 + sampleRateOverride: 44100 + compressionFormat: 1 + quality: 1 + conversionMode: 0 + preloadAudioData: 0 + platformSettingOverrides: {} + forceToMono: 0 + normalize: 1 + loadInBackground: 0 + ambisonic: 0 + 3D: 1 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Prefabs/Ship/Ship.prefab b/Assets/Prefabs/Ship/Ship.prefab index 29edaeb..e3d6668 100755 --- a/Assets/Prefabs/Ship/Ship.prefab +++ b/Assets/Prefabs/Ship/Ship.prefab @@ -220,6 +220,64 @@ MonoBehaviour: m_Name: m_EditorClassIdentifier: ship: {fileID: 1093091269199902593} +--- !u!1 &4508084525431060037 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 7603488991399315273} + - component: {fileID: 2362953346451262734} + - component: {fileID: 6156246831092198731} + m_Layer: 10 + m_Name: Audio + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &7603488991399315273 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 4508084525431060037} + serializedVersion: 2 + 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: 3589635702276405719} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!114 &2362953346451262734 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 4508084525431060037} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 9bcaa1cfcea9cae4bb92bdc96cfbb4d2, type: 3} + m_Name: + m_EditorClassIdentifier: + soundNames: 020000000300000004000000 + clips: + - {fileID: 8300000, guid: 613e0b85af271854f9d89cb48db1445b, type: 3} + - {fileID: 8300000, guid: 0384b39259118674781276c265b83dec, type: 3} + - {fileID: 8300000, guid: b34b1ec00bb1ba643afcdc88ea960e06, type: 3} +--- !u!81 &6156246831092198731 +AudioListener: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 4508084525431060037} + m_Enabled: 1 --- !u!1 &5535911989893287240 GameObject: m_ObjectHideFlags: 0 @@ -445,6 +503,7 @@ Transform: - {fileID: 1526924705325842294} - {fileID: 3869627124329100603} - {fileID: 2024927552184032925} + - {fileID: 7603488991399315273} m_Father: {fileID: 0} m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} --- !u!33 &3273845117821321837 diff --git a/Assets/Resources/URPAsset.asset b/Assets/Resources/URPAsset.asset old mode 100644 new mode 100755 diff --git a/Assets/Scenes/sr_junglism2.unity b/Assets/Scenes/sr_junglism2.unity old mode 100644 new mode 100755 index ee84c3d..9e01f45 --- a/Assets/Scenes/sr_junglism2.unity +++ b/Assets/Scenes/sr_junglism2.unity @@ -865,13 +865,13 @@ Transform: m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 52048083} + serializedVersion: 2 m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} m_LocalPosition: {x: 977.23474, y: -165.7302, z: -2086.4595} m_LocalScale: {x: 1, y: 1, z: 1} m_ConstrainProportionsScale: 0 m_Children: [] m_Father: {fileID: 0} - m_RootOrder: 0 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} --- !u!1001 &55853259 PrefabInstance: @@ -3760,6 +3760,7 @@ Transform: m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 203474076} + serializedVersion: 2 m_LocalRotation: {x: -0, y: 0.7071068, z: -0, w: 0.7071068} m_LocalPosition: {x: 2578.8755, y: 251.83788, z: 212.81699} m_LocalScale: {x: 1, y: 1, z: 1} @@ -3767,7 +3768,6 @@ Transform: m_Children: - {fileID: 887408362} m_Father: {fileID: 766862835} - m_RootOrder: -2 m_LocalEulerAnglesHint: {x: 0, y: 90, z: 0} --- !u!114 &203474082 MonoBehaviour: @@ -7726,13 +7726,13 @@ Transform: m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 475149571} + serializedVersion: 2 m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} m_LocalPosition: {x: 3146.8, y: 251, z: 311.4} m_LocalScale: {x: 1, y: 1, z: 1} m_ConstrainProportionsScale: 0 m_Children: [] m_Father: {fileID: 0} - m_RootOrder: 3 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} --- !u!1001 &475769272 PrefabInstance: @@ -10801,13 +10801,13 @@ Transform: m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 705507993} + serializedVersion: 2 m_LocalRotation: {x: -0.27417248, y: -0.3337574, z: 0.3633117, w: 0.8254938} m_LocalPosition: {x: -365.9992, y: -2002.0156, z: -426.01685} m_LocalScale: {x: 1, y: 1, z: 1} m_ConstrainProportionsScale: 0 m_Children: [] m_Father: {fileID: 1906469785} - m_RootOrder: -2 m_LocalEulerAnglesHint: {x: -167.869, y: 129.88, z: -126.800995} --- !u!114 &705507997 MonoBehaviour: @@ -11918,13 +11918,13 @@ Transform: m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 755742072} + serializedVersion: 2 m_LocalRotation: {x: -0, y: -0.9998229, z: -0, w: -0.018819254} m_LocalPosition: {x: 0, y: 0, z: 0} m_LocalScale: {x: 1, y: 1, z: 1} m_ConstrainProportionsScale: 0 m_Children: [] m_Father: {fileID: 1136171772} - m_RootOrder: -2 m_LocalEulerAnglesHint: {x: 0, y: -182.157, z: 0} --- !u!73398921 &755742074 VFXRenderer: @@ -13763,13 +13763,13 @@ Transform: m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 887408361} + serializedVersion: 2 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: 203474081} - m_RootOrder: -2 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} --- !u!73398921 &887408363 VFXRenderer: @@ -14927,6 +14927,7 @@ Transform: m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 955820482} + serializedVersion: 2 m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} m_LocalPosition: {x: -1773.5925, y: -52.500008, z: 877.1588} m_LocalScale: {x: 1, y: 1, z: 1} @@ -15356,7 +15357,6 @@ Transform: - {fileID: 1651403266} - {fileID: 112688477} m_Father: {fileID: 2050641105} - m_RootOrder: -2 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} --- !u!1001 &956530159 PrefabInstance: @@ -18699,6 +18699,7 @@ Transform: m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 1136171767} + serializedVersion: 2 m_LocalRotation: {x: 0, y: 0, z: 0.7071068, w: 0.7071068} m_LocalPosition: {x: 1654.8756, y: -183.06215, z: -2418.183} m_LocalScale: {x: 1, y: 1, z: 1} @@ -18706,7 +18707,6 @@ Transform: m_Children: - {fileID: 755742073} m_Father: {fileID: 766862835} - m_RootOrder: -2 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 90} --- !u!114 &1136171773 MonoBehaviour: @@ -32197,6 +32197,7 @@ Transform: m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 1906469784} + serializedVersion: 2 m_LocalRotation: {x: 0.71074754, y: 0.5701635, z: -0.3333826, w: 0.24209014} m_LocalPosition: {x: 2416.41, y: 267.92, z: -1402} m_LocalScale: {x: 1, y: 1, z: 1} @@ -32204,7 +32205,6 @@ Transform: m_Children: - {fileID: 705507995} m_Father: {fileID: 0} - m_RootOrder: 1 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} --- !u!4 &1913193847 stripped Transform: @@ -33530,7 +33530,8 @@ PrefabInstance: propertyPath: m_Name value: Ship objectReference: {fileID: 0} - m_RemovedComponents: [] + m_RemovedComponents: + - {fileID: 7510218262252450460, guid: 217f9c8f922f2d41cac52c3699bde478, type: 3} m_RemovedGameObjects: [] m_AddedGameObjects: [] m_AddedComponents: [] @@ -34160,6 +34161,7 @@ Transform: m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 2050641104} + serializedVersion: 2 m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} m_LocalPosition: {x: 1773.5925, y: 52.500008, z: -877.1588} m_LocalScale: {x: 1, y: 1, z: 1} @@ -34167,7 +34169,6 @@ Transform: m_Children: - {fileID: 955820483} m_Father: {fileID: 0} - m_RootOrder: 2 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} --- !u!1001 &2059307177 PrefabInstance: @@ -35798,3 +35799,14 @@ PrefabInstance: m_AddedGameObjects: [] m_AddedComponents: [] m_SourcePrefab: {fileID: 100100000, guid: 87a51212e10250274a8feda6be865b7c, type: 3} +--- !u!1660057539 &9223372036854775807 +SceneRoots: + m_ObjectHideFlags: 0 + m_Roots: + - {fileID: 52048085} + - {fileID: 1906469785} + - {fileID: 2050641105} + - {fileID: 475149573} + - {fileID: 766862834} + - {fileID: 327871849} + - {fileID: 2015948213} diff --git a/Assets/Scenes/sr_silverstorage.unity b/Assets/Scenes/sr_silverstorage.unity old mode 100644 new mode 100755 index 1f9e464..efe04c9 --- a/Assets/Scenes/sr_silverstorage.unity +++ b/Assets/Scenes/sr_silverstorage.unity @@ -333,13 +333,13 @@ Transform: m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 705507993} + serializedVersion: 2 m_LocalRotation: {x: -0.27417248, y: -0.3337574, z: 0.3633117, w: 0.8254938} m_LocalPosition: {x: 0, y: 100, z: 0} m_LocalScale: {x: 1, y: 1, z: 1} m_ConstrainProportionsScale: 0 m_Children: [] m_Father: {fileID: 1906469785} - m_RootOrder: -2 m_LocalEulerAnglesHint: {x: -167.869, y: 129.88, z: -126.800995} --- !u!114 &705507997 MonoBehaviour: @@ -536,6 +536,7 @@ Transform: m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 965851723} + serializedVersion: 2 m_LocalRotation: {x: -0, y: -0.9914445, z: -0, w: 0.13052872} m_LocalPosition: {x: 0, y: 0, z: 0} m_LocalScale: {x: 0.66, y: 0.66, z: 0.66} @@ -543,7 +544,6 @@ Transform: m_Children: - {fileID: 1556238047} m_Father: {fileID: 0} - m_RootOrder: 1 m_LocalEulerAnglesHint: {x: 0, y: -165, z: 0} --- !u!114 &1088368772 stripped MonoBehaviour: @@ -556,6 +556,28 @@ MonoBehaviour: m_Script: {fileID: 11500000, guid: 385acf04d40a396a9a95f738b7353198, type: 3} m_Name: m_EditorClassIdentifier: +--- !u!1 &1359172646 stripped +GameObject: + m_CorrespondingSourceObject: {fileID: 4508084525431060037, guid: 217f9c8f922f2d41cac52c3699bde478, type: 3} + m_PrefabInstance: {fileID: 5198188376350273124} + m_PrefabAsset: {fileID: 0} +--- !u!114 &1359172648 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1359172646} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 566ffe93221add0489d9a9a01670b93a, type: 3} + m_Name: + m_EditorClassIdentifier: + soundNames: 020000000300000004000000 + clips: + - {fileID: 8300000, guid: 613e0b85af271854f9d89cb48db1445b, type: 3} + - {fileID: 8300000, guid: 0384b39259118674781276c265b83dec, type: 3} + - {fileID: 8300000, guid: b34b1ec00bb1ba643afcdc88ea960e06, type: 3} --- !u!1001 &1556238046 PrefabInstance: m_ObjectHideFlags: 0 @@ -865,6 +887,7 @@ Transform: m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 1906469784} + serializedVersion: 2 m_LocalRotation: {x: 0.71074754, y: 0.5701635, z: -0.3333826, w: 0.24209014} m_LocalPosition: {x: 0, y: 0, z: 0} m_LocalScale: {x: 1, y: 1, z: 1} @@ -872,7 +895,6 @@ Transform: m_Children: - {fileID: 705507995} m_Father: {fileID: 0} - m_RootOrder: 0 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} --- !u!114 &1972710421 stripped MonoBehaviour: @@ -1157,10 +1179,15 @@ PrefabInstance: propertyPath: m_Name value: Ship objectReference: {fileID: 0} - m_RemovedComponents: [] + m_RemovedComponents: + - {fileID: 2362953346451262734, guid: 217f9c8f922f2d41cac52c3699bde478, type: 3} + - {fileID: 6156246831092198731, guid: 217f9c8f922f2d41cac52c3699bde478, type: 3} m_RemovedGameObjects: [] m_AddedGameObjects: [] - m_AddedComponents: [] + m_AddedComponents: + - targetCorrespondingSourceObject: {fileID: 4508084525431060037, guid: 217f9c8f922f2d41cac52c3699bde478, type: 3} + insertIndex: -1 + addedObject: {fileID: 1359172648} m_SourcePrefab: {fileID: 100100000, guid: 217f9c8f922f2d41cac52c3699bde478, type: 3} --- !u!114 &5198188376350273125 stripped MonoBehaviour: @@ -1195,3 +1222,12 @@ MonoBehaviour: m_Script: {fileID: 11500000, guid: 8401c141ee093632d847505914412cee, type: 3} m_Name: m_EditorClassIdentifier: +--- !u!1660057539 &9223372036854775807 +SceneRoots: + m_ObjectHideFlags: 0 + m_Roots: + - {fileID: 1906469785} + - {fileID: 965851724} + - {fileID: 656092325660581143} + - {fileID: 5198188376350273124} + - {fileID: 766862834} diff --git a/Assets/Src/Audio.cs b/Assets/Src/Audio.cs deleted file mode 100755 index 21f1917..0000000 --- a/Assets/Src/Audio.cs +++ /dev/null @@ -1,56 +0,0 @@ -using System.Collections; -using System.Collections.Generic; - -using UnityEngine; - -public enum Sound { - MenuLow, - MenuHigh, - - Accelerate, - Decelerate, - Strafe, - - Damage, - Respawn, - - BoostAcceleration, - BoostDeceleration, - BoostStrafe, - BoostShield, - - BoostGenerate, - BoostAvailable, - BoostFull, - BoostDrain, -} - -[RequireComponent(typeof(AudioSource))] -public class Audio : MonoBehaviour { - [SerializeField] - Sound[] soundNames; - - [SerializeField] - AudioClip[] clips; - - Dictionary sounds = new(); - - AudioSource source; - - void Start() { - source = GetComponent(); - - for (int i = 0; i < clips.Length; i++) { - sounds.Add(soundNames[i], clips[i]); - } - } - - public void PlaySound(Sound s) { - AudioClip clip; - bool found = sounds.TryGetValue(s, out clip); - if (clip) { - source.clip = clip; - source.Play(0); - } - } -} \ No newline at end of file diff --git a/Assets/Src/ShipAudio.cs b/Assets/Src/ShipAudio.cs new file mode 100755 index 0000000..dde6374 --- /dev/null +++ b/Assets/Src/ShipAudio.cs @@ -0,0 +1,183 @@ +using System; +using System.Collections; +using System.Collections.Generic; + +using UnityEngine; +using UnityEngine.InputSystem; + +public enum Sound { + MenuLow, + MenuHigh, + + Accelerate, + Decelerate, + Strafe, + + Damage, + Respawn, + + BoostAcceleration, + BoostDeceleration, + BoostStrafe, + BoostShield, + + BoostGenerate, + BoostAvailable, + BoostFull, + BoostDrain, +} + +public class ShipAudio : MonoBehaviour { + // Match these two up + [SerializeField] + Sound[] soundNames; + + [SerializeField] + AudioClip[] clips; + + Dictionary sounds = new(); + + AudioSource srcAccel; + AudioSource srcDecel; + AudioSource srcStrafe; + + SpaceRaceInput input; + ShipControls ship; + + void Awake() { + for (int i = 0; i < clips.Length; i++) { + sounds.Add(soundNames[i], clips[i]); + } + + ship = GetComponentInParent(); + + srcAccel = gameObject.AddComponent(); + srcAccel.clip = sounds[Sound.Accelerate]; + srcAccel.loop = true; + srcAccel.volume = 0f; + srcAccel.Play(); + + srcDecel = gameObject.AddComponent(); + srcDecel.clip = sounds[Sound.Decelerate]; + srcDecel.loop = true; + srcDecel.volume = 0f; + srcDecel.Play(); + + srcStrafe = gameObject.AddComponent(); + srcStrafe.clip = sounds[Sound.Strafe]; + srcStrafe.loop = true; + srcStrafe.volume = 0f; + srcStrafe.Play(); + + RegisterEvents(); + } + + void Update() { + srcAccel.pitch = Math.Min(1f, (1f / 500f) * ship.Speed); + srcDecel.pitch = Math.Min(1f, (1f / 500f) * ship.Speed); + srcStrafe.pitch = Math.Min(1f, (1f / 500f) * ship.Speed); + + // Super fucking annoying + // stops all the clicks and pops of starting / stopping the clips + // 0.125s to get max volume + // == 8x per second... + float volumeDelta = Time.deltaTime / 8000; + + bool accelerating = input.ship.accelerate.ReadValue() > 0; + bool decelerating = input.ship.decelerate.ReadValue() > 0; + bool strafing = input.ship.strafe.ReadValue().magnitude > 0; + + if (accelerating) { + srcAccel.volume = Math.Max(1f, srcAccel.volume + volumeDelta); + } else { + srcAccel.volume = Math.Min(0f, srcAccel.volume - volumeDelta); + } + + if (decelerating) { + srcDecel.volume = Math.Max(1f, srcDecel.volume + volumeDelta); + } else { + srcDecel.volume = Math.Min(0f, srcDecel.volume - volumeDelta); + } + + if (strafing) { + srcStrafe.volume = Math.Max(1f, srcStrafe.volume + volumeDelta); + } else { + srcStrafe.volume = Math.Min(0f, srcStrafe.volume - volumeDelta); + } + } + + + // public void PlaySound(Sound s) { + // AudioSource src = sounds[s]; + // src.Play(0); + // } + + void RegisterEvents() { + if (input == null) + input = new SpaceRaceInput(); + + input.ship.Enable(); + + // input.ship.accelerate.started += OnAccelerateStart; + // input.ship.accelerate.canceled += OnAccelerateCancel; + // input.ship.decelerate.started += OnDecelerateStart; + // input.ship.decelerate.canceled += OnDecelerateCancel; + // input.ship.strafe.started += OnStrafeStart; + // input.ship.strafe.canceled += OnStrafeCancel; + + // these we only care about the initial press + // input.ship.respawn.started += OnRespawn; + // input.ship.quit.started += OnQuit; + // input.ship.powerUnit1.started += OnPowerUnit1; + // input.ship.powerUnit2.started += OnPowerUnit2; + // input.ship.powerUnit3.started += OnPowerUnit3; + // input.ship.powerUnit4.started += OnPowerUnit4; + } + + // void OnDestroy() { + // input.ship.accelerate.started -= OnAccelerateStart; + // input.ship.accelerate.canceled -= OnAccelerateCancel; + // input.ship.decelerate.started -= OnDecelerateStart; + // input.ship.decelerate.canceled -= OnDecelerateCancel; + // input.ship.strafe.started -= OnStrafeStart; + // input.ship.strafe.canceled -= OnStrafeCancel; + + + // // these we only care about the initial press + // input.ship.respawn.started -= OnRespawn; + // input.ship.quit.started -= OnQuit; + // input.ship.powerUnit1.started -= OnPowerUnit1; + // input.ship.powerUnit2.started -= OnPowerUnit2; + // input.ship.powerUnit3.started -= OnPowerUnit3; + // input.ship.powerUnit4.started -= OnPowerUnit4; + // } + + // void OnAcceleratePerformed(InputAction.CallbackContext _ctx) { + // Debug.Log(_ctx.duration); + // } + + // void OnAccelerateStart(InputAction.CallbackContext _ctx) { + // srcAccel.Play(); + // } + + // void OnAccelerateCancel(InputAction.CallbackContext _ctx) { + // srcAccel.Stop(); + // } + + // void OnDecelerateStart(InputAction.CallbackContext _ctx) { + // srcDecel.Play(); + // } + + // void OnDecelerateCancel(InputAction.CallbackContext _ctx) { + // srcDecel.Stop(); + // } + + // void OnStrafeStart(InputAction.CallbackContext _ctx) { + // srcStrafe.Play(); + // } + + // void OnStrafeCancel(InputAction.CallbackContext _ctx) { + // srcStrafe.Stop(); + // } +} + diff --git a/Assets/Src/Audio.cs.meta b/Assets/Src/ShipAudio.cs.meta similarity index 83% rename from Assets/Src/Audio.cs.meta rename to Assets/Src/ShipAudio.cs.meta index ff72c4a..bd9f3ca 100755 --- a/Assets/Src/Audio.cs.meta +++ b/Assets/Src/ShipAudio.cs.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: 9bcaa1cfcea9cae4bb92bdc96cfbb4d2 +guid: 566ffe93221add0489d9a9a01670b93a MonoImporter: externalObjects: {} serializedVersion: 2 diff --git a/Assets/Src/ShipControls.cs b/Assets/Src/ShipControls.cs index c7119c6..619e271 100755 --- a/Assets/Src/ShipControls.cs +++ b/Assets/Src/ShipControls.cs @@ -47,6 +47,10 @@ public class ShipControls : MonoBehaviour { public float Speed => rigidBody.velocity.magnitude; + // used for audio + public bool Accelerating => input.ship.accelerate.ReadValue() > 0; + public bool Decelerating => input.ship.decelerate.ReadValue() > 0; + void Start() { Cursor.lockState = CursorLockMode.Locked; rigidBody = GetComponent(); diff --git a/Assets/Src/UI/MenuControls.cs b/Assets/Src/UI/MenuControls.cs index 833dea4..5d86d34 100644 --- a/Assets/Src/UI/MenuControls.cs +++ b/Assets/Src/UI/MenuControls.cs @@ -29,7 +29,7 @@ public class MenuControls : MonoBehaviour { ControlsUI controlsUI; [SerializeField] - Audio audio; + ShipAudio audio; SpaceRaceInput input; diff --git a/Packages/packages-lock.json b/Packages/packages-lock.json index cd5a96f..1271455 100755 --- a/Packages/packages-lock.json +++ b/Packages/packages-lock.json @@ -7,7 +7,7 @@ "dependencies": {} }, "com.unity.burst": { - "version": "1.8.7", + "version": "1.8.8", "depth": 1, "source": "registry", "dependencies": { diff --git a/ProjectSettings/ProjectSettings.asset b/ProjectSettings/ProjectSettings.asset old mode 100644 new mode 100755 index e78549c..ac57a9d --- a/ProjectSettings/ProjectSettings.asset +++ b/ProjectSettings/ProjectSettings.asset @@ -88,6 +88,7 @@ PlayerSettings: hideHomeButton: 0 submitAnalytics: 1 usePlayerLog: 1 + dedicatedServerOptimizations: 0 bakeCollisionMeshes: 0 forceSingleInstance: 0 useFlipModelSwapchain: 1 @@ -127,6 +128,7 @@ PlayerSettings: switchNVNMaxPublicTextureIDCount: 0 switchNVNMaxPublicSamplerIDCount: 0 switchNVNGraphicsFirmwareMemory: 32 + switchMaxWorkerMultiple: 8 stadiaPresentMode: 0 stadiaTargetFramerate: 0 vulkanNumSwapchainBuffers: 3 @@ -136,8 +138,7 @@ PlayerSettings: vulkanEnableCommandBufferRecycling: 1 loadStoreDebugModeEnabled: 0 bundleVersion: 1.0 - preloadedAssets: - - {fileID: 11400000, guid: 020903acd8b50dd45a683fb9312ba7af, type: 2} + preloadedAssets: [] metroInputSource: 0 wsaTransparentSwapchain: 0 m_HolographicPauseOnTrackingLoss: 1 @@ -186,8 +187,8 @@ PlayerSettings: tvOSSdkVersion: 0 tvOSRequireExtendedGameController: 0 tvOSTargetOSVersionString: 12.0 - bratwurstSdkVersion: 0 - bratwurstTargetOSVersionString: 16.4 + VisionOSSdkVersion: 0 + VisionOSTargetOSVersionString: 1.0 uIPrerenderedIcon: 0 uIRequiresPersistentWiFi: 0 uIRequiresFullScreen: 1 @@ -235,10 +236,10 @@ PlayerSettings: appleDeveloperTeamID: iOSManualSigningProvisioningProfileID: tvOSManualSigningProvisioningProfileID: - bratwurstManualSigningProvisioningProfileID: + VisionOSManualSigningProvisioningProfileID: iOSManualSigningProvisioningProfileType: 0 tvOSManualSigningProvisioningProfileType: 0 - bratwurstManualSigningProvisioningProfileType: 0 + VisionOSManualSigningProvisioningProfileType: 0 appleEnableAutomaticSigning: 0 iOSRequireARKit: 0 iOSAutomaticallyDetectAndAddCapabilities: 1 diff --git a/ProjectSettings/VFXManager.asset b/ProjectSettings/VFXManager.asset old mode 100644 new mode 100755 index 807920d..87823a9 --- a/ProjectSettings/VFXManager.asset +++ b/ProjectSettings/VFXManager.asset @@ -12,6 +12,6 @@ VFXManager: m_MaxDeltaTime: 0.05 m_MaxScrubTime: 30 m_CompiledVersion: 7 - m_RuntimeVersion: 33 + m_RuntimeVersion: 35 m_RuntimeResources: {fileID: 11400000, guid: bc10b42afe3813544bffd38ae2cd893d, type: 2} m_BatchEmptyLifetime: 300