using System; using FairyGUI; using UI.Launcher; using UnityEngine; namespace GFGGame { public class LauncherAgreeView : Window { private static LauncherAgreeView m_Instance = null; /// /// 单例 /// public static LauncherAgreeView Instance { get { if (m_Instance == null) { m_Instance = new LauncherAgreeView(); } return m_Instance; } } private Action _onHideCallback; public void Open(Action onHide) { _onHideCallback = onHide; Show(); } private UI_LauncherAgreeUI _ui; protected override void OnInit() { base.OnInit(); _ui = UI_LauncherAgreeUI.Create(); this.contentPane = _ui.target; this.Center(); //this.modal = true; _ui.m_btnLeft.onClick.Add(() => { this.Hide(); Application.Quit(); }); _ui.m_btnRight.onClick.Add(() => { this.Hide(); LocalCache.SetBool(LauncherConfig.LAST_LOGIN_IS_AGREE_KEY, true); _onHideCallback?.Invoke(); }); _ui.m_loaEventa.onClick.Add(() => { FullScreenTextController.Show("event:a"); }); _ui.m_loaEventb.onClick.Add(() => { FullScreenTextController.Show("event:b"); }); _ui.m_loaEventc.onClick.Add(() => { FullScreenTextController.Show("event:c"); }); } protected override void OnShown() { base.OnShown(); } protected override void OnHide() { base.OnHide(); } } }