diff --git a/CHANGELOG.md b/CHANGELOG.md index e0c73a7..54e603b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,12 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## [2.4.0] - 2024-05-24 + +### Fixed + +- More audios in client. + ## [2.3.1] - 2024-05-23 ### Fixed @@ -282,6 +288,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Nothing. +[2.4.0]: https://github.com/thuasta/thuai-7/compare/v2.3.1...v2.4.0 [2.3.1]: https://github.com/thuasta/thuai-7/compare/v2.3.0...v2.3.1 [2.3.0]: https://github.com/thuasta/thuai-7/compare/v2.2.0...v2.3.0 [2.2.0]: https://github.com/thuasta/thuai-7/compare/v2.1.0...v2.2.0 diff --git a/client/Assets/Resources/Music/Audio/heal.mp3 b/client/Assets/Resources/Music/Audio/heal.mp3 new file mode 100644 index 0000000..d16a484 Binary files /dev/null and b/client/Assets/Resources/Music/Audio/heal.mp3 differ diff --git a/client/Assets/Resources/Music/Audio/heal.mp3.meta b/client/Assets/Resources/Music/Audio/heal.mp3.meta new file mode 100644 index 0000000..2d4a0ab --- /dev/null +++ b/client/Assets/Resources/Music/Audio/heal.mp3.meta @@ -0,0 +1,23 @@ +fileFormatVersion: 2 +guid: 3c57c31990156ce4c91b1c3708ceef30 +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/client/Assets/Resources/Music/Audio/hurt.mp3 b/client/Assets/Resources/Music/Audio/hurt.mp3 new file mode 100644 index 0000000..2e18b70 Binary files /dev/null and b/client/Assets/Resources/Music/Audio/hurt.mp3 differ diff --git a/client/Assets/Resources/Music/Audio/hurt.mp3.meta b/client/Assets/Resources/Music/Audio/hurt.mp3.meta new file mode 100644 index 0000000..cfa6b7e --- /dev/null +++ b/client/Assets/Resources/Music/Audio/hurt.mp3.meta @@ -0,0 +1,23 @@ +fileFormatVersion: 2 +guid: 76f8a8921dc856b4d9af9b4d0af1a71c +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/client/Assets/Scripts/ReplayLoader/Record.cs b/client/Assets/Scripts/ReplayLoader/Record.cs index 6f35f5a..cb4bf24 100644 --- a/client/Assets/Scripts/ReplayLoader/Record.cs +++ b/client/Assets/Scripts/ReplayLoader/Record.cs @@ -202,6 +202,9 @@ private void Start() { "Die", Resources.Load("Music/Audio/die") }, { "Grenade", Resources.Load("Music/Audio/grenade") }, { "Pickup", Resources.Load("Music/Audio/pickup") }, + { "Heal", Resources.Load("Music/Audio/heal") }, + { "Hurt", Resources.Load("Music/Audio/hurt") }, + { "Die", Resources.Load("Music/Audio/die") }, }; _grenadeExplosionPrefab = Resources.Load("Prefabs/BigExplosionEffect"); _grenadeBeamPrefab = Resources.Load("Beam/GrenadeBeam"); @@ -534,6 +537,19 @@ private void UpdatePlayers(JArray players) } } int health = player["health"].ToObject(); + Player nowPlayer = PlayerSource.GetPlayers()[playerId]; + if(nowPlayer is not null) + { + if (nowPlayer.Health- health > 5) + { + // Play hurt audio + _as.PlayOneShot(_audioClipDict["Hurt"]); + } + if (health < 1) + { + _as.PlayOneShot(_audioClipDict["Die"]); + } + } PlayerSource.UpdatePlayer( playerId, health, @@ -674,6 +690,7 @@ private void AfterPlayerAttackEvent(JObject eventJson) private void AfterPlayerUseMedicineEvent(JObject eventJson) { int playerId = eventJson["data"]["playerId"].ToObject(); + _as.PlayOneShot(_audioClipDict["Heal"]); PlayerSource.GetPlayers()[playerId].UseMedicine(); } diff --git a/client/ProjectSettings/ProjectSettings.asset b/client/ProjectSettings/ProjectSettings.asset index 194ca1e..bc999b4 100644 --- a/client/ProjectSettings/ProjectSettings.asset +++ b/client/ProjectSettings/ProjectSettings.asset @@ -135,7 +135,7 @@ PlayerSettings: vulkanEnableLateAcquireNextImage: 0 vulkanEnableCommandBufferRecycling: 1 loadStoreDebugModeEnabled: 0 - bundleVersion: 2.3.1 + bundleVersion: 2.4.0 preloadedAssets: [] metroInputSource: 0 wsaTransparentSwapchain: 0 diff --git a/server/src/GameServer/GameServer.csproj b/server/src/GameServer/GameServer.csproj index 78b085a..0da3bbd 100644 --- a/server/src/GameServer/GameServer.csproj +++ b/server/src/GameServer/GameServer.csproj @@ -6,7 +6,7 @@ enable enable true - 2.3.1 + 2.4.0