using Assets.PhxhSDK.AOT.BI; using System; using Obfuz; using TMPro; using UnityEngine; using UnityEngine.UI; namespace HotUpdate.UI { [ObfuzIgnore] 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; /// /// Aot版本 /// public TextMeshProUGUI m_TextAotVersion; /// /// 当前资源版本 /// public TextMeshProUGUI m_TextCurResVersion; /// /// 最新资源版本 /// public TextMeshProUGUI m_TextNewResVersion; 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 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(LocalizeMono.Instance.GetLocalizeText("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(); BIToolinAOT.Instance.TrackEventInAOT("app_privacy_permission", new System.Collections.Generic.Dictionary() { {"result", 0 }//0: success }); } public void OnClickPrivacyCancel() { m_PrivacyDialogObj.SetActive(false); BIToolinAOT.Instance.TrackEventInAOT("app_privacy_permission", new System.Collections.Generic.Dictionary() { {"result", 1 }//1: cancel }); Application.Quit(); } private void OnDestroy() { if (Instance == this) { Instance = null; } } } }