Skip to content

Commit

Permalink
hotfix: Sound 크기가 일관되지않은 버그 수정
Browse files Browse the repository at this point in the history
  • Loading branch information
scarleter99 committed Jul 15, 2024
1 parent 8f70d5e commit a73fe53
Show file tree
Hide file tree
Showing 6 changed files with 73 additions and 36 deletions.
Binary file modified Client/Assets/Resources/Sounds/Effects/Crew/Antipsychotic.mp3
Binary file not shown.
Binary file modified Client/Assets/Resources/Sounds/Effects/Crew/Morphine.mp3
Binary file not shown.
64 changes: 63 additions & 1 deletion Client/Assets/Scenes/TestScene/TestScene_SJ.unity
Original file line number Diff line number Diff line change
Expand Up @@ -718,6 +718,67 @@ PrefabInstance:
m_AddedGameObjects: []
m_AddedComponents: []
m_SourcePrefab: {fileID: 100100000, guid: 651267bc0bc8c0a4fbf95c442517d389, type: 3}
--- !u!1001 &183473100
PrefabInstance:
m_ObjectHideFlags: 0
serializedVersion: 2
m_Modification:
serializedVersion: 3
m_TransformParent: {fileID: 0}
m_Modifications:
- target: {fileID: 1343902041442310, guid: 56acb4b35ef0e5740ae197b1dfa1a4a8, type: 3}
propertyPath: m_Name
value: MedKit_Bandage
objectReference: {fileID: 0}
- target: {fileID: 4837046210294490, guid: 56acb4b35ef0e5740ae197b1dfa1a4a8, type: 3}
propertyPath: m_LocalPosition.x
value: 1.2881497
objectReference: {fileID: 0}
- target: {fileID: 4837046210294490, guid: 56acb4b35ef0e5740ae197b1dfa1a4a8, type: 3}
propertyPath: m_LocalPosition.y
value: 0.50369143
objectReference: {fileID: 0}
- target: {fileID: 4837046210294490, guid: 56acb4b35ef0e5740ae197b1dfa1a4a8, type: 3}
propertyPath: m_LocalPosition.z
value: -1.8
objectReference: {fileID: 0}
- target: {fileID: 4837046210294490, guid: 56acb4b35ef0e5740ae197b1dfa1a4a8, type: 3}
propertyPath: m_LocalRotation.w
value: 1
objectReference: {fileID: 0}
- target: {fileID: 4837046210294490, guid: 56acb4b35ef0e5740ae197b1dfa1a4a8, type: 3}
propertyPath: m_LocalRotation.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 4837046210294490, guid: 56acb4b35ef0e5740ae197b1dfa1a4a8, type: 3}
propertyPath: m_LocalRotation.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 4837046210294490, guid: 56acb4b35ef0e5740ae197b1dfa1a4a8, type: 3}
propertyPath: m_LocalRotation.z
value: 0
objectReference: {fileID: 0}
- target: {fileID: 4837046210294490, guid: 56acb4b35ef0e5740ae197b1dfa1a4a8, type: 3}
propertyPath: m_LocalEulerAnglesHint.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 4837046210294490, guid: 56acb4b35ef0e5740ae197b1dfa1a4a8, type: 3}
propertyPath: m_LocalEulerAnglesHint.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 4837046210294490, guid: 56acb4b35ef0e5740ae197b1dfa1a4a8, type: 3}
propertyPath: m_LocalEulerAnglesHint.z
value: 0
objectReference: {fileID: 0}
- target: {fileID: 6666183428592964458, guid: 56acb4b35ef0e5740ae197b1dfa1a4a8, type: 3}
propertyPath: SortKey
value: 2531991717
objectReference: {fileID: 0}
m_RemovedComponents: []
m_RemovedGameObjects: []
m_AddedGameObjects: []
m_AddedComponents: []
m_SourcePrefab: {fileID: 100100000, guid: 56acb4b35ef0e5740ae197b1dfa1a4a8, type: 3}
--- !u!1001 &234444228
PrefabInstance:
m_ObjectHideFlags: 0
Expand Down Expand Up @@ -5293,7 +5354,7 @@ MonoBehaviour:
m_Name:
m_EditorClassIdentifier:
DefaultRoomName: Test
Creature: 1
Creature: 2
PrefabNum: 0
ReadySceneSpawnPosition: {x: 1.2, y: 0, z: 0}
ReadySceneSpawnSector: 1
Expand Down Expand Up @@ -11648,6 +11709,7 @@ SceneRoots:
- {fileID: 702667825}
- {fileID: 1230568782}
- {fileID: 133869399}
- {fileID: 183473100}
- {fileID: 2107820290}
- {fileID: 1712376117}
- {fileID: 2100522929}
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,6 @@ public void PlaySound(Define.AlienActionType alienActionType)
case Define.AlienActionType.GetBlind:
Rpc_PlayDamaged();
break;
case Define.AlienActionType.CrashDoor:
Rpc_PlayCrashDoor();
break;
case Define.AlienActionType.Hit:
Rpc_PlayHit();
break;
Expand Down Expand Up @@ -58,12 +55,6 @@ protected void Rpc_PlayDamaged()
Managers.SoundMng.PlayObjectAudio(CreatureAudioSource, $"{Define.EFFECT_PATH}/Alien/Damaged_Alien", pitch: 1f, volume: 1f, isLoop: false);
}

[Rpc(RpcSources.StateAuthority, RpcTargets.All)]
protected void Rpc_PlayCrashDoor()
{
Managers.SoundMng.PlayObjectAudio(CreatureAudioSource, $"{Define.EFFECT_PATH}/Alien/CrashDoor", pitch: 1f, volume: 1f, isLoop: false);
}

[Rpc(RpcSources.StateAuthority, RpcTargets.All)]
protected void Rpc_PlayBasicAttack()
{
Expand Down
23 changes: 10 additions & 13 deletions Client/Assets/Scripts/Contents/Controllers/CrewSoundController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -34,24 +34,24 @@ public void PlaySound(Define.CrewActionType crewActionType)
Rpc_PlayDamagedSound();
break;
case Define.CrewActionType.Dead:
Rpc_PlayDeadSound();
PlayDeadSound();
break;
case Define.CrewActionType.Bandage:
Rpc_PlayBandageSound();
break;
case Define.CrewActionType.Antipsychotic:
Rpc_PlayAntipsychoticSound();
PlayAntipsychoticSound();
break;
case Define.CrewActionType.Morphine:
Rpc_PlayMorphineSound();
PlayMorphineSound();
break;
}
}

[Rpc(RpcSources.StateAuthority, RpcTargets.All)]
protected void Rpc_PlayFootStepSound(float pitch, float volume)
{
Managers.SoundMng.PlayObjectAudio(CreatureAudioSource, $"{Define.EFFECT_PATH}/Crew/FootStep", pitch, volume, isLoop: true);
Managers.SoundMng.PlayObjectAudio(CreatureAudioSource, $"{Define.EFFECT_PATH}/Crew/FootStep", pitch, volume, isLoop:true);
}

[Rpc(RpcSources.StateAuthority, RpcTargets.All)]
Expand All @@ -61,10 +61,9 @@ protected void Rpc_PlayDamagedSound()
Managers.SoundMng.PlayObjectAudio(CreatureAudioSource, $"{Define.EFFECT_PATH}/Crew/Damaged", pitch: 1f, volume: 0.5f, isLoop: false);
}

[Rpc(RpcSources.StateAuthority, RpcTargets.StateAuthority)]
protected void Rpc_PlayDeadSound()
protected void PlayDeadSound()
{
Managers.SoundMng.PlayObjectAudio(CreatureAudioSource, $"{Define.EFFECT_PATH}/Crew/GameOver", pitch: 1f, volume: 1f, isLoop: false);
Managers.SoundMng.Play($"{Define.EFFECT_PATH}/Crew/GameOver", Define.SoundType.Effect, volume:1f, isOneShot: true);
}

[Rpc(RpcSources.StateAuthority, RpcTargets.All)]
Expand All @@ -73,16 +72,14 @@ protected void Rpc_PlayBandageSound()
Managers.SoundMng.PlayObjectAudio(CreatureAudioSource, $"{Define.EFFECT_PATH}/Crew/Bandage", pitch: 1f, volume: 1f, isLoop: true);
}

[Rpc(RpcSources.StateAuthority, RpcTargets.All)]
protected void Rpc_PlayAntipsychoticSound()
protected void PlayAntipsychoticSound()
{
Managers.SoundMng.PlayOneShotObjectAudio(CreatureAudioSource, $"{Define.EFFECT_PATH}/Crew/Antipsychotic", volume: 1f);
Managers.SoundMng.Play($"{Define.EFFECT_PATH}/Crew/Antipsychotic", Define.SoundType.Effect, volume:0.5f, isOneShot: true);
}

[Rpc(RpcSources.StateAuthority, RpcTargets.All)]
protected void Rpc_PlayMorphineSound()
protected void PlayMorphineSound()
{
Managers.SoundMng.PlayOneShotObjectAudio(CreatureAudioSource, $"{Define.EFFECT_PATH}/Crew/Morphine", volume: 1f);
Managers.SoundMng.Play($"{Define.EFFECT_PATH}/Crew/Morphine", Define.SoundType.Effect, volume:0.35f, isOneShot: true);
}

public override void CheckChasing()
Expand Down
13 changes: 0 additions & 13 deletions Client/Assets/Scripts/Managers/Core/SoundManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -110,19 +110,6 @@ public void PlayObjectAudio(AudioSource audioSource, string path, float pitch =
audioSource.Play();
}

public void PlayOneShotObjectAudio(AudioSource audioSource, string path, float volume = 1.0f)
{
if (audioSource == null)
return;

AudioClip clip = Managers.SoundMng.GetOrAddAudioClip(path);

if (clip == null)
return;

audioSource.PlayOneShot(clip, volume * CustomAudioVolume(Define.SoundType.Environment));
}

public void Stop(Define.SoundType type = Define.SoundType.Effect)
{
AudioSource audioSource;
Expand Down

0 comments on commit a73fe53

Please sign in to comment.