36 lines
967 B
C#
36 lines
967 B
C#
using UnityEngine;
|
|
|
|
public enum eOption { Sound, Bgm }
|
|
public enum eMoney { AlbumOpen, Chat, Gacha, Lucky, MiniGameHP, ItemBomb, ItemUmbrella, ItemDildo }
|
|
|
|
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)
|
|
{
|
|
if (!SaveMgr.Ins.Get_Option(option))
|
|
SoundInfo.Ins.Stop_BGM();
|
|
else
|
|
SoundInfo.Ins.RePlay_BGM();
|
|
}
|
|
}
|
|
|
|
public void OnClick_OtherGame(string url)
|
|
{
|
|
Application.OpenURL(url);
|
|
}
|
|
} |