12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455 |
- 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;
- }
- 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();
- }
- }
- }
- }
|