123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657 |
- using UnityEngine;
- using FairyGUI;
- using UI.Login;
- namespace GFGGame
- {
- public class FullScreenTextView : BaseWindow
- {
- private UI_FullScreenTextUI _ui;
- public override void Dispose()
- {
- if (_ui != null)
- {
- _ui.Dispose();
- _ui = null;
- }
- base.Dispose();
- }
- protected override void OnInit()
- {
- base.OnInit();
- packageName = UI_FullScreenTextUI.PACKAGE_NAME;
- _ui = UI_FullScreenTextUI.Create();
- this.viewCom = _ui.target;
- this.modal = true;
- isfullScreen = true;
- _ui.m_btnBack.onClick.Add(this.Hide);
- }
- protected override void OnShown()
- {
- base.OnShown();
- string content = (string)viewData;
- _ui.m_txtComp.m_txtContent.text = content;
- _ui.m_txtComp.target.scrollPane.ScrollTop();
- Timers.inst.AddUpdate(Update);
- }
- protected override void OnHide()
- {
- base.OnHide();
- Timers.inst.Remove(Update);
- }
- private void Update(object param)
- {
- if (Input.GetKeyDown(KeyCode.Escape) || Input.GetKeyDown(KeyCode.Home))
- {
- this.Hide();
- }
- }
- }
- }
|