From 88cd72fe0adcc0c176de9ff80af6a0d8efd676e2 Mon Sep 17 00:00:00 2001 From: huluoboya3 <93986295+huluoboya3@users.noreply.github.com> Date: Sat, 8 Mar 2025 09:08:34 +0800 Subject: [PATCH 1/3] Update WwiseObjectAtHome.cs Fixed noise issues --- CustomEmotesAPI/Utils/WwiseObjectAtHome.cs | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/CustomEmotesAPI/Utils/WwiseObjectAtHome.cs b/CustomEmotesAPI/Utils/WwiseObjectAtHome.cs index 09bf53d..5648eaa 100644 --- a/CustomEmotesAPI/Utils/WwiseObjectAtHome.cs +++ b/CustomEmotesAPI/Utils/WwiseObjectAtHome.cs @@ -46,26 +46,23 @@ private void Update() needToContinueOnFinish = false; audioSource.loop = true; } - if (audioSource.isPlaying) + if (audioSource.isPlaying && mapper.playerController!= null && mapper.playerController.IsOwner) { - audioTimer += Time.deltaTime; - if (audioTimer > .75f) - { audioSource.volume = Settings.EmotesVolume.Value / 100f; - audioTimer -= .75f; if (Settings.EmotesAlertEnemies.Value) { - if (mapper.playerController is not null) + if (mapper.playerController != null && noiseInterval <= 0f) { - RoundManager.Instance.PlayAudibleNoise(mapper.mapperBody.transform.position, 30, mapper.currentAudioLevel, 0, mapper.playerController.isInHangarShipRoom && mapper.playerController.playersManager.hangarDoorsClosed, 5); + audioTimer = 1f; + roundManager.PlayAudibleNoise(mapper.mapperBody.transform.position, 30f, mapper.currentAudioLevel, 0, mapper.playerController.isInHangarShipRoom && mapper.playerController.playersManager.hangarDoorsClosed, 5); } else { - //RoundManager.Instance.PlayAudibleNoise(mapper.mapperBody.transform.position, 30, mapper.currentAudioLevel, 0, false, 5); + audioTimer -= Time.deltaTime; } } - } } + } public void Play(int syncPos, int currEvent, bool looping, bool sync, bool willGetClaimed) { From 67d2569a90d147ee3d6a54d575f8cbd00795d7b6 Mon Sep 17 00:00:00 2001 From: huluoboya3 <93986295+huluoboya3@users.noreply.github.com> Date: Sat, 8 Mar 2025 09:13:20 +0800 Subject: [PATCH 2/3] Update WwiseObjectAtHome.cs --- CustomEmotesAPI/Utils/WwiseObjectAtHome.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CustomEmotesAPI/Utils/WwiseObjectAtHome.cs b/CustomEmotesAPI/Utils/WwiseObjectAtHome.cs index 5648eaa..43cc4c8 100644 --- a/CustomEmotesAPI/Utils/WwiseObjectAtHome.cs +++ b/CustomEmotesAPI/Utils/WwiseObjectAtHome.cs @@ -51,7 +51,7 @@ private void Update() audioSource.volume = Settings.EmotesVolume.Value / 100f; if (Settings.EmotesAlertEnemies.Value) { - if (mapper.playerController != null && noiseInterval <= 0f) + if (noiseInterval <= 0f) { audioTimer = 1f; roundManager.PlayAudibleNoise(mapper.mapperBody.transform.position, 30f, mapper.currentAudioLevel, 0, mapper.playerController.isInHangarShipRoom && mapper.playerController.playersManager.hangarDoorsClosed, 5); From 82ae136c9b3f60eb161b1d0cfed27bf9f07baa27 Mon Sep 17 00:00:00 2001 From: huluoboya3 <93986295+huluoboya3@users.noreply.github.com> Date: Sat, 8 Mar 2025 10:05:08 +0800 Subject: [PATCH 3/3] Update WwiseObjectAtHome.cs --- CustomEmotesAPI/Utils/WwiseObjectAtHome.cs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/CustomEmotesAPI/Utils/WwiseObjectAtHome.cs b/CustomEmotesAPI/Utils/WwiseObjectAtHome.cs index 43cc4c8..6669c69 100644 --- a/CustomEmotesAPI/Utils/WwiseObjectAtHome.cs +++ b/CustomEmotesAPI/Utils/WwiseObjectAtHome.cs @@ -46,15 +46,15 @@ private void Update() needToContinueOnFinish = false; audioSource.loop = true; } - if (audioSource.isPlaying && mapper.playerController!= null && mapper.playerController.IsOwner) + if (audioSource.isPlaying && mapper.playerController is not null && mapper.playerController.IsOwner) { audioSource.volume = Settings.EmotesVolume.Value / 100f; if (Settings.EmotesAlertEnemies.Value) { - if (noiseInterval <= 0f) + if (audioTimer <= 0f) { audioTimer = 1f; - roundManager.PlayAudibleNoise(mapper.mapperBody.transform.position, 30f, mapper.currentAudioLevel, 0, mapper.playerController.isInHangarShipRoom && mapper.playerController.playersManager.hangarDoorsClosed, 5); + RoundManager.Instance.PlayAudibleNoise(mapper.mapperBody.transform.position, 30f, mapper.currentAudioLevel, 0, mapper.playerController.isInHangarShipRoom && mapper.playerController.playersManager.hangarDoorsClosed, 5); } else {