DO-44 [Feat] 패널 클릭 클로즈 사운드 추가
This commit is contained in:
parent
1b1bd4fb98
commit
9422bb0670
BIN
Assets/Resources/Click Sound.mp3
Normal file
BIN
Assets/Resources/Click Sound.mp3
Normal file
Binary file not shown.
23
Assets/Resources/Click Sound.mp3.meta
Normal file
23
Assets/Resources/Click Sound.mp3.meta
Normal file
@ -0,0 +1,23 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: cff2e6cf7f46a074d86955b3b6fd499a
|
||||||
|
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:
|
BIN
Assets/Resources/Close Sound.mp3
Normal file
BIN
Assets/Resources/Close Sound.mp3
Normal file
Binary file not shown.
23
Assets/Resources/Close Sound.mp3.meta
Normal file
23
Assets/Resources/Close Sound.mp3.meta
Normal file
@ -0,0 +1,23 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: e7c0f32158a3e5b46bc3b59035aba898
|
||||||
|
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:
|
@ -10,6 +10,7 @@ GameObject:
|
|||||||
m_Component:
|
m_Component:
|
||||||
- component: {fileID: 2402232447803946232}
|
- component: {fileID: 2402232447803946232}
|
||||||
- component: {fileID: 3667565604047053759}
|
- component: {fileID: 3667565604047053759}
|
||||||
|
- component: {fileID: 841089304725320238}
|
||||||
m_Layer: 0
|
m_Layer: 0
|
||||||
m_Name: Audio Manager
|
m_Name: Audio Manager
|
||||||
m_TagString: Untagged
|
m_TagString: Untagged
|
||||||
@ -45,3 +46,102 @@ MonoBehaviour:
|
|||||||
m_Name:
|
m_Name:
|
||||||
m_EditorClassIdentifier:
|
m_EditorClassIdentifier:
|
||||||
mainBgm: {fileID: 8300000, guid: 1d9c7fb20aa822c48933d00b6bd6a757, type: 3}
|
mainBgm: {fileID: 8300000, guid: 1d9c7fb20aa822c48933d00b6bd6a757, type: 3}
|
||||||
|
clickSound: {fileID: 8300000, guid: cff2e6cf7f46a074d86955b3b6fd499a, type: 3}
|
||||||
|
closeSound: {fileID: 8300000, guid: e7c0f32158a3e5b46bc3b59035aba898, type: 3}
|
||||||
|
sfxVolume: 0
|
||||||
|
--- !u!82 &841089304725320238
|
||||||
|
AudioSource:
|
||||||
|
m_ObjectHideFlags: 0
|
||||||
|
m_CorrespondingSourceObject: {fileID: 0}
|
||||||
|
m_PrefabInstance: {fileID: 0}
|
||||||
|
m_PrefabAsset: {fileID: 0}
|
||||||
|
m_GameObject: {fileID: 2946408323859178723}
|
||||||
|
m_Enabled: 1
|
||||||
|
serializedVersion: 4
|
||||||
|
OutputAudioMixerGroup: {fileID: 0}
|
||||||
|
m_audioClip: {fileID: 0}
|
||||||
|
m_PlayOnAwake: 1
|
||||||
|
m_Volume: 1
|
||||||
|
m_Pitch: 1
|
||||||
|
Loop: 0
|
||||||
|
Mute: 0
|
||||||
|
Spatialize: 0
|
||||||
|
SpatializePostEffects: 0
|
||||||
|
Priority: 128
|
||||||
|
DopplerLevel: 1
|
||||||
|
MinDistance: 1
|
||||||
|
MaxDistance: 500
|
||||||
|
Pan2D: 0
|
||||||
|
rolloffMode: 0
|
||||||
|
BypassEffects: 0
|
||||||
|
BypassListenerEffects: 0
|
||||||
|
BypassReverbZones: 0
|
||||||
|
rolloffCustomCurve:
|
||||||
|
serializedVersion: 2
|
||||||
|
m_Curve:
|
||||||
|
- serializedVersion: 3
|
||||||
|
time: 0
|
||||||
|
value: 1
|
||||||
|
inSlope: 0
|
||||||
|
outSlope: 0
|
||||||
|
tangentMode: 0
|
||||||
|
weightedMode: 0
|
||||||
|
inWeight: 0.33333334
|
||||||
|
outWeight: 0.33333334
|
||||||
|
- serializedVersion: 3
|
||||||
|
time: 1
|
||||||
|
value: 0
|
||||||
|
inSlope: 0
|
||||||
|
outSlope: 0
|
||||||
|
tangentMode: 0
|
||||||
|
weightedMode: 0
|
||||||
|
inWeight: 0.33333334
|
||||||
|
outWeight: 0.33333334
|
||||||
|
m_PreInfinity: 2
|
||||||
|
m_PostInfinity: 2
|
||||||
|
m_RotationOrder: 4
|
||||||
|
panLevelCustomCurve:
|
||||||
|
serializedVersion: 2
|
||||||
|
m_Curve:
|
||||||
|
- serializedVersion: 3
|
||||||
|
time: 0
|
||||||
|
value: 0
|
||||||
|
inSlope: 0
|
||||||
|
outSlope: 0
|
||||||
|
tangentMode: 0
|
||||||
|
weightedMode: 0
|
||||||
|
inWeight: 0.33333334
|
||||||
|
outWeight: 0.33333334
|
||||||
|
m_PreInfinity: 2
|
||||||
|
m_PostInfinity: 2
|
||||||
|
m_RotationOrder: 4
|
||||||
|
spreadCustomCurve:
|
||||||
|
serializedVersion: 2
|
||||||
|
m_Curve:
|
||||||
|
- serializedVersion: 3
|
||||||
|
time: 0
|
||||||
|
value: 0
|
||||||
|
inSlope: 0
|
||||||
|
outSlope: 0
|
||||||
|
tangentMode: 0
|
||||||
|
weightedMode: 0
|
||||||
|
inWeight: 0.33333334
|
||||||
|
outWeight: 0.33333334
|
||||||
|
m_PreInfinity: 2
|
||||||
|
m_PostInfinity: 2
|
||||||
|
m_RotationOrder: 4
|
||||||
|
reverbZoneMixCustomCurve:
|
||||||
|
serializedVersion: 2
|
||||||
|
m_Curve:
|
||||||
|
- serializedVersion: 3
|
||||||
|
time: 0
|
||||||
|
value: 1
|
||||||
|
inSlope: 0
|
||||||
|
outSlope: 0
|
||||||
|
tangentMode: 0
|
||||||
|
weightedMode: 0
|
||||||
|
inWeight: 0.33333334
|
||||||
|
outWeight: 0.33333334
|
||||||
|
m_PreInfinity: 2
|
||||||
|
m_PostInfinity: 2
|
||||||
|
m_RotationOrder: 4
|
||||||
|
@ -3,13 +3,20 @@
|
|||||||
[RequireComponent(typeof(AudioSource))]
|
[RequireComponent(typeof(AudioSource))]
|
||||||
public class AudioManager : MonoBehaviour
|
public class AudioManager : MonoBehaviour
|
||||||
{
|
{
|
||||||
[Header("Sound")]
|
[Header("BGM")]
|
||||||
[SerializeField] private AudioClip mainBgm;
|
[SerializeField] private AudioClip mainBgm;
|
||||||
|
[Header("SFX")]
|
||||||
|
[SerializeField] private AudioClip clickSound;
|
||||||
|
[SerializeField] private AudioClip closeSound;
|
||||||
|
|
||||||
private AudioSource audioSource;
|
private AudioSource audioSource;
|
||||||
|
|
||||||
|
[HideInInspector] public float sfxVolume;
|
||||||
|
|
||||||
private void Start()
|
private void Start()
|
||||||
{
|
{
|
||||||
PlayMainBGM();
|
PlayMainBGM();
|
||||||
|
sfxVolume = 1.0f; //테스트 코드
|
||||||
}
|
}
|
||||||
|
|
||||||
// 배경음악 시작
|
// 배경음악 시작
|
||||||
@ -23,7 +30,7 @@ public class AudioManager : MonoBehaviour
|
|||||||
// 배경음악이 설정되면 재생
|
// 배경음악이 설정되면 재생
|
||||||
audioSource.clip = mainBgm; // 음악 클립 설정
|
audioSource.clip = mainBgm; // 음악 클립 설정
|
||||||
audioSource.loop = true; // 반복 재생
|
audioSource.loop = true; // 반복 재생
|
||||||
audioSource.volume = 0.2f; // 볼륨
|
audioSource.volume = 0.1f; // 볼륨
|
||||||
audioSource.Play(); // 음악 시작
|
audioSource.Play(); // 음악 시작
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -36,4 +43,14 @@ public class AudioManager : MonoBehaviour
|
|||||||
audioSource.Stop(); // 배경음악 멈추기
|
audioSource.Stop(); // 배경음악 멈추기
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void PlayClickSound()
|
||||||
|
{
|
||||||
|
audioSource.PlayOneShot(clickSound, sfxVolume);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void PlayCloseSound()
|
||||||
|
{
|
||||||
|
audioSource.PlayOneShot(closeSound, sfxVolume);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -24,6 +24,8 @@ public class PanelController : MonoBehaviour
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
public void Show()
|
public void Show()
|
||||||
{
|
{
|
||||||
|
GameManager.Instance.audioManager.PlayClickSound();
|
||||||
|
|
||||||
if (backGroundCanvasGroup == null)
|
if (backGroundCanvasGroup == null)
|
||||||
{
|
{
|
||||||
backGroundCanvasGroup = GetComponent<CanvasGroup>();
|
backGroundCanvasGroup = GetComponent<CanvasGroup>();
|
||||||
@ -42,6 +44,8 @@ public class PanelController : MonoBehaviour
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
public void Hide(PanelControllerHideDelegate hideDelegate = null)
|
public void Hide(PanelControllerHideDelegate hideDelegate = null)
|
||||||
{
|
{
|
||||||
|
GameManager.Instance.audioManager.PlayCloseSound();
|
||||||
|
|
||||||
backGroundCanvasGroup.alpha = 1;
|
backGroundCanvasGroup.alpha = 1;
|
||||||
panelRectTransform.localScale = Vector3.one;
|
panelRectTransform.localScale = Vector3.one;
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user