Shegotwet/Assets/Scripts/UI/OptionUI.cs

36 lines
967 B
C#
Raw Normal View History

2025-09-11 06:10:39 +00:00
using UnityEngine;
public enum eOption { Sound, Bgm }
public enum eMoney { AlbumOpen, Chat, Gacha, Lucky, MiniGameHP, ItemBomb, ItemUmbrella, ItemDildo }
2025-09-11 06:10:39 +00:00
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();
2025-09-13 22:08:25 +00:00
if (option == eOption.Bgm)
{
if (!SaveMgr.Ins.Get_Option(option))
SoundInfo.Ins.Stop_BGM();
else
SoundInfo.Ins.RePlay_BGM();
}
2025-09-11 06:10:39 +00:00
}
public void OnClick_OtherGame(string url)
2025-09-11 06:10:39 +00:00
{
Application.OpenURL(url);
2025-09-11 06:10:39 +00:00
}
}