Shegotwet/Assets/Scripts/UI/OptionUI.cs

36 lines
942 B
C#

using UnityEngine;
public enum eOption { Sound, Bgm }
public class OptionUI : MonoBehaviour
{
[SerializeField] GameObject[] onoff_sound, onoff_bgm;
public void Set()
{
gameObject.SetActive(true);
DSUtil.InActivateGameObjects(onoff_sound, SaveMgr.Ins.Get_Option(eOption.Sound) ? 0 : 1);
DSUtil.InActivateGameObjects(onoff_bgm, SaveMgr.Ins.Get_Option(eOption.Bgm) ? 0 : 1);
}
public void OnClick_Toggle(int index)
{
var option = (eOption)index;
SaveMgr.Ins.Set_Option(option);
Set();
if (option == eOption.Bgm && !SaveMgr.Ins.Get_Option(option)) SoundInfo.Ins.Stop_BGM();
}
public void OnClick_Game(int index)
{
switch (index)
{
case 0:
// 원스토어
// 구글
Application.OpenURL("market://details?id=com.fgb.randomgfgostop");
break;
}
}
}