153 lines
5.4 KiB
C#
153 lines
5.4 KiB
C#
using CodeStage.AntiCheat.Storage;
|
|
using System;
|
|
using System.Collections.Generic;
|
|
using TMPro;
|
|
using UnityEngine;
|
|
using UnityEngine.Networking;
|
|
using UnityEngine.UI;
|
|
|
|
public class OptionInfo : MonoBehaviourSingletonTemplateBackKeyAdd<OptionInfo>
|
|
{
|
|
//[RuntimeInitializeOnLoadMethod]
|
|
//static void OnRuntimeMethodLoad()
|
|
//{
|
|
// new GameObject("OptionInfo").AddComponent<OptionInfo>();
|
|
//}
|
|
|
|
public GameObject go_OptionUI;
|
|
public Slider slider_BGM, slider_SFX;
|
|
public GameObject[] go_check; // 0 데미지 텍스트, 1 그림자, 2 자동 적 추적 카메라, 3 로컬푸시, 4 야간로컬푸시
|
|
public Image sprite_loginicon;
|
|
public GameObject[] gos_resoultion; // 0 상, 1 중, 2 하
|
|
public TextMeshProUGUI lable_ver, label_id;
|
|
public TextMeshProUGUI tmp_bgm, tmp_sfx;
|
|
public TMP_InputField if_coupon;
|
|
|
|
protected override void Awake()
|
|
{
|
|
base.Awake();
|
|
Screen.sleepTimeout = SleepTimeout.NeverSleep; // 게임 실행 중 화면 안 꺼지게
|
|
//QualitySettings.SetQualityLevel(PlayerPrefs.GetInt("QualitySettings", 1)); // 퀄리티 중을 기본으로
|
|
}
|
|
|
|
private void Start()
|
|
{
|
|
go_OptionUI.SetActive(false);
|
|
}
|
|
|
|
public override void Set()
|
|
{
|
|
base.Set();
|
|
lable_ver.text = DSUtil.Format("{0}({1})", Application.version, ServerInfo.Ins.VersionCode);
|
|
go_OptionUI.SetActive(true);
|
|
Set_UI();
|
|
//label_id.text = ServerInfo.Ins.m_LoginInfo.PlayFabId;
|
|
|
|
switch (ObscuredPrefs.GetInt(MyValue.OptionKey_UserType))
|
|
{
|
|
case 1: // 애플
|
|
sprite_loginicon.sprite = UIAtlasMgr.Ins.Get_Sprite("option_apple"); break;
|
|
case 2: // 구글
|
|
sprite_loginicon.sprite = UIAtlasMgr.Ins.Get_Sprite("option_google"); break;
|
|
default: // 게스트
|
|
sprite_loginicon.sprite = UIAtlasMgr.Ins.Get_Sprite("option_guest"); break;
|
|
}
|
|
}
|
|
|
|
public void Set_UI()
|
|
{
|
|
//slider_BGM.value = PlayerPrefs.GetFloat("BGM", 1f);
|
|
//slider_SFX.value = PlayerPrefs.GetFloat("SFX", 1f);
|
|
//go_check[0].SetActive(PlayerPrefs.GetInt("DamageText", 1) == 1);
|
|
//go_check[1].SetActive(PlayerPrefs.GetInt("Shadow", 1) == 1);
|
|
//go_check[2].SetActive(PlayerPrefs.GetInt("AutoCam", 1) == 1);
|
|
}
|
|
|
|
public void OnChangeValue_BGM()
|
|
{
|
|
PlayerPrefs.SetFloat("BGM", slider_BGM.value);
|
|
SoundInfo.Ins.Set_BGM_Volume(slider_BGM.value);
|
|
tmp_bgm.text = $"{Mathf.RoundToInt(slider_BGM.value * 100f)}%";
|
|
}
|
|
public void OnChangeValue_SFX()
|
|
{
|
|
PlayerPrefs.SetFloat("SFX", slider_SFX.value);
|
|
tmp_sfx.text = $"{Mathf.RoundToInt(slider_SFX.value * 100f)}%";
|
|
}
|
|
public void Set_DamageText() { PlayerPrefs.SetInt("DamageText", go_check[0].activeInHierarchy ? 0 : 1); Set_UI(); }
|
|
|
|
public void OnClick_Logout()
|
|
{
|
|
Popup.Ins.Set(ePopupType.Two, 104,
|
|
() =>
|
|
{
|
|
//ServerInfo.Ins.Write(() =>
|
|
//{
|
|
// ObscuredPrefs.DeleteKey(MyValue.OptionKey_UserType);
|
|
// DSUtil.Quit();
|
|
//});
|
|
});
|
|
}
|
|
public void OnClick_QuitSave() { Popup.Ins.Set_QuitPopup(); }
|
|
|
|
public override void OnClick_Back()
|
|
{
|
|
go_OptionUI.SetActive(false);
|
|
BackKeyMgr.Ins.Del_Back(OnClick_Back);
|
|
//GuideQuestArrow.Ins.gos_arrow[34].gos[0].SetActive(NewGameUI.Ins.m_GuideQuestUI.Get_Purpose() == ePurpose.OptionHelp
|
|
// && ServerInfo.Ins.m_ServerData.Get_Common(eCommon.GuideClear) == 0);
|
|
}
|
|
|
|
public void Open_TermsofService()
|
|
{
|
|
WebViewInfo.Ins.Show_WebView("https://docs.google.com/document/d/e/2PACX-1vQMdLgj1VKEsBRDyFja1sY5b2wGdFlSLCKxI6vt3oIpC4iyXQl8A1hjVKlwcP3HKca-izcBaIT6BlRT/pub");
|
|
}
|
|
|
|
public void Open_EULA()
|
|
{
|
|
WebViewInfo.Ins.Show_WebView("https://docs.google.com/document/d/e/2PACX-1vQRGNDeyuk4WrC8HsYc61HP9cS66lJwxuKuHgmn9-Sugn1JFnpZ3bKJJUugPiw1Qf0BDxbVSdL0f31v/pub");
|
|
}
|
|
|
|
public void OnClick_Help()
|
|
{
|
|
string mailto = "admin@filgoodbandits.com";
|
|
string subject = EscapeURL("제목을 입력해주세요.");
|
|
string body = EscapeURL
|
|
(
|
|
"문의사항을 입력해주세요." +
|
|
"\n\n\n\n" +
|
|
"작은 마녀 이야기---------------------\n" +
|
|
//"ID : " + ServerInfo.Ins.m_LoginInfo.PlayFabId + "\n\n" +
|
|
"Device Model : " + SystemInfo.deviceModel + "\n\n" +
|
|
"Device OS : " + SystemInfo.operatingSystem + "\n" +
|
|
"---------------------------------------------------"
|
|
);
|
|
|
|
Application.OpenURL("mailto:" + mailto + "?subject=" + subject + "&body=" + body);
|
|
}
|
|
|
|
private string EscapeURL(string url)
|
|
{
|
|
return UnityWebRequest.EscapeURL(url).Replace("+", "%20");
|
|
}
|
|
public void OnClick_CopyID()
|
|
{
|
|
TextEditor te = new TextEditor { text = label_id.text };
|
|
te.SelectAll();
|
|
te.Copy();
|
|
ToastUI.Ins.Set(114);
|
|
}
|
|
|
|
public void OnClick_Resolution(GameObject _go)
|
|
{
|
|
int index = int.Parse(_go.name);
|
|
QualitySettings.SetQualityLevel(index);
|
|
PlayerPrefs.SetInt("QualitySettings", index);
|
|
Set_UI();
|
|
}
|
|
}
|
|
|
|
[Serializable]
|
|
class RewardData { public string Reward; public int RewardID; public double RewardAmount; }
|
|
[Serializable]
|
|
class RootRewardData { public List<RewardData> Rewards; } |