NLDClient-yudde/ProjectNLD/Assets/Code/Scripts/HotUpdate/UI/TempUpdateUI.cs

92 lines
3.4 KiB
C#
Raw Blame History

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

using System;
using TMPro;
using UnityEngine;
using UnityEngine.UI;
namespace Code.Scripts.HotUpdate.UI
{
public class TempUpdateUI : MonoBehaviour
{
public Camera UICamera;
public GameObject m_DialogObj;
public GameObject m_ProgressObj;
public GameObject m_PrivacyDialogObj;
public Slider m_SliderProgress;
public TextMeshProUGUI m_textSliderProgress;
public TextMeshProUGUI m_TextProgress;
//public TextMeshProUGUI m_TextTitle;
public TextMeshProUGUI m_TextContent;
/// <summary>
/// 版本
/// </summary>
public TextMeshProUGUI m_TextVersion;
public LinkTextAOT PrivacyAgreementText;
public static TempUpdateUI Instance { get; private set; }
public bool isClickOk;
public Action PrivacyAgreeCallback;
string url1 = "https://kedrgame.com/user_agreement.txt";
string url2 = "https://kedrgame.com/privacy_agreement.txt";
string url3 = "https://kedrgame.com/";
private string privacyContent =
" 感谢您对本游戏的支持。为了更好的保护您的个人信息,在使用本游戏前,请您充分阅读并理解我们的<link=\"{0}\"><u>《用户协议》</u></link>以及<link=\"{1}\"><u>《隐私协议》</u></link>\r\n" +
" 1.保护用户隐私是本游戏的一项基本政策,本游戏不会泄露您的个人信息;\r\n" +
" 2.我们会根据您使用的具体功能需要,收集必要的用户信息(如申请设备信息,存储等相关权限);\r\n" +
" 3.在您同意App隐私政策后我们将进行集成SDK的初始化工作会收集您的android_id、Mac地址、IMEI和应用安装列表以\r\n" +
"保障App正常数据统计和安全风控;\r\n" +
" 4.为了方便您的查阅,您可以通过我们官方网页(<link=\"{2}\"><u>https://kedrgame.com/</u></link>)重新查看该协议;\r\n" +
" 5.您可以阅读完整版的隐私保护政策了解我们申请使用相关权限的情况,以及对您个人隐私的保护措施。";
private void Awake()
{
Instance = this;
#if DEVELOPMENT_BUILD || DEBUG
if(m_DialogObj.TryGetComponent(out Button btn))
btn.enabled = true;
#else
if(m_DialogObj.TryGetComponent(out Button btn))
btn.enabled = false;
#endif
m_DialogObj.SetActive(false);
m_ProgressObj.SetActive(false);
m_PrivacyDialogObj.SetActive(false);
PrivacyAgreementText.SetText(string.Format(privacyContent, url1, url2, url3));
}
public void OnClickOk()
{
isClickOk = true;
m_DialogObj.SetActive(false);
}
public void OnClickCancel()
{
isClickOk = false;
m_DialogObj.SetActive(false);
Application.Quit();
#if UNITY_EDITOR
UnityEditor.EditorApplication.isPlaying = false;
#endif
}
public void OnClickPrivacyOk()
{
PlayerPrefs.SetInt("PrivacyAgreement", BIManager.Agree_Privacy);
m_PrivacyDialogObj.SetActive(false);
PrivacyAgreeCallback?.Invoke();
}
public void OnClickPrivacyCancel()
{
m_PrivacyDialogObj.SetActive(false);
Application.Quit();
}
}
}