Skip to content
This repository has been archived by the owner on May 26, 2024. It is now read-only.

Commit

Permalink
Merge pull request #215 from Zhangyr2022/main
Browse files Browse the repository at this point in the history
Prepare release
  • Loading branch information
Zhangyr2022 authored May 24, 2024
2 parents 43215c6 + 27d3b6c commit 11b5b29
Show file tree
Hide file tree
Showing 8 changed files with 72 additions and 2 deletions.
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
Binary file added client/Assets/Resources/Music/Audio/heal.mp3
Binary file not shown.
23 changes: 23 additions & 0 deletions client/Assets/Resources/Music/Audio/heal.mp3.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Binary file added client/Assets/Resources/Music/Audio/hurt.mp3
Binary file not shown.
23 changes: 23 additions & 0 deletions client/Assets/Resources/Music/Audio/hurt.mp3.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

17 changes: 17 additions & 0 deletions client/Assets/Scripts/ReplayLoader/Record.cs
Original file line number Diff line number Diff line change
Expand Up @@ -202,6 +202,9 @@ private void Start()
{ "Die", Resources.Load<AudioClip>("Music/Audio/die") },
{ "Grenade", Resources.Load<AudioClip>("Music/Audio/grenade") },
{ "Pickup", Resources.Load<AudioClip>("Music/Audio/pickup") },
{ "Heal", Resources.Load<AudioClip>("Music/Audio/heal") },
{ "Hurt", Resources.Load<AudioClip>("Music/Audio/hurt") },
{ "Die", Resources.Load<AudioClip>("Music/Audio/die") },
};
_grenadeExplosionPrefab = Resources.Load<GameObject>("Prefabs/BigExplosionEffect");
_grenadeBeamPrefab = Resources.Load<GameObject>("Beam/GrenadeBeam");
Expand Down Expand Up @@ -534,6 +537,19 @@ private void UpdatePlayers(JArray players)
}
}
int health = player["health"].ToObject<int>();
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,
Expand Down Expand Up @@ -674,6 +690,7 @@ private void AfterPlayerAttackEvent(JObject eventJson)
private void AfterPlayerUseMedicineEvent(JObject eventJson)
{
int playerId = eventJson["data"]["playerId"].ToObject<int>();
_as.PlayOneShot(_audioClipDict["Heal"]);
PlayerSource.GetPlayers()[playerId].UseMedicine();
}

Expand Down
2 changes: 1 addition & 1 deletion client/ProjectSettings/ProjectSettings.asset
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ PlayerSettings:
vulkanEnableLateAcquireNextImage: 0
vulkanEnableCommandBufferRecycling: 1
loadStoreDebugModeEnabled: 0
bundleVersion: 2.3.1
bundleVersion: 2.4.0
preloadedAssets: []
metroInputSource: 0
wsaTransparentSwapchain: 0
Expand Down
2 changes: 1 addition & 1 deletion server/src/GameServer/GameServer.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
<Version>2.3.1</Version>
<Version>2.4.0</Version>
</PropertyGroup>

<ItemGroup>
Expand Down

0 comments on commit 11b5b29

Please sign in to comment.