Merge branch 'main' into DO-46-게임-씬-보조-기능-추가

This commit is contained in:
Lim0_C 2025-03-27 14:27:27 +09:00
commit eb873e6d13
3 changed files with 12 additions and 6 deletions

View File

@ -14,7 +14,7 @@ GameObject:
- component: {fileID: 6789969287113785900}
- component: {fileID: 413977444317235173}
m_Layer: 5
m_Name: Switch
m_Name: BGM Switch
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
@ -762,7 +762,7 @@ GameObject:
- component: {fileID: 3464089222698319368}
- component: {fileID: 8434701791193156984}
m_Layer: 5
m_Name: Switch
m_Name: SFX Switch
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0

View File

@ -19,7 +19,7 @@ public class AudioManager : Singleton<AudioManager>
private Dictionary<string, AudioClip> audioClips = new Dictionary<string, AudioClip>();
private void Awake()
protected override void Awake()
{
base.Awake(); // 부모 클래스의 Awake 호출

View File

@ -19,7 +19,6 @@ public class SwitchController : MonoBehaviour
private RectTransform _handleRectTransform;
private Image _backgroundImage;
private AudioSource _audioSource;
private bool _isOn;
@ -27,7 +26,6 @@ public class SwitchController : MonoBehaviour
{
_handleRectTransform = handleImage.GetComponent<RectTransform>();
_backgroundImage = GetComponent<Image>();
_audioSource = GetComponent<AudioSource>();
}
private void Start()
@ -35,7 +33,15 @@ public class SwitchController : MonoBehaviour
//초기 상태는 false
_handleRectTransform.anchoredPosition = new Vector2(-14, 0);
_backgroundImage.color = OffColor;
_isOn = false;
if (gameObject.name == "SFX Switch")
{
_isOn = UserManager.IsPlaySFX;
}
else if (gameObject.name == "BGM Switch")
{
_isOn = UserManager.IsPlayBGM;
}
}
//스위치 상태 변경 함수