Merge pull request #65 from Degulleo/DO-67-세팅-패널-스위치-버튼-클릭-버그-픽스
Do-67 [Fix] 세팅 패널 스위치 버튼 클릭 수정
This commit is contained in:
commit
c780870f70
@ -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
|
||||
|
@ -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 호출
|
||||
|
||||
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
//스위치 상태 변경 함수
|
||||
|
Loading…
x
Reference in New Issue
Block a user