From 6eb915c129fc90c6f4c82ae097dd6ffad5239efc Mon Sep 17 00:00:00 2001 From: chai Date: Mon, 25 Jan 2021 14:28:30 +0800 Subject: +scripts --- Client/Assets/Scripts/XMainClient/InGameADView.cs | 93 +++++++++++++++++++++++ 1 file changed, 93 insertions(+) create mode 100644 Client/Assets/Scripts/XMainClient/InGameADView.cs (limited to 'Client/Assets/Scripts/XMainClient/InGameADView.cs') diff --git a/Client/Assets/Scripts/XMainClient/InGameADView.cs b/Client/Assets/Scripts/XMainClient/InGameADView.cs new file mode 100644 index 00000000..c3366e94 --- /dev/null +++ b/Client/Assets/Scripts/XMainClient/InGameADView.cs @@ -0,0 +1,93 @@ +using System; +using UILib; +using XMainClient.UI.UICommon; +using XUtliPoolLib; + +namespace XMainClient +{ + internal class InGameADView : DlgBase + { + private uint npcID + { + get + { + return uint.Parse(XSingleton.singleton.GetValue("InGameADNPCID")); + } + } + + private string tex + { + get + { + return XSingleton.singleton.GetValue("InGameADTex"); + } + } + + public override string fileName + { + get + { + return "GameSystem/InGameAD"; + } + } + + public override int layer + { + get + { + return 1; + } + } + + public override int group + { + get + { + return 1; + } + } + + public override bool autoload + { + get + { + return true; + } + } + + public override void RegisterEvent() + { + base.uiBehaviour.m_Close.RegisterClickEventHandler(new ButtonClickEventHandler(this.OnCloseClicked)); + base.uiBehaviour.m_BtnGo.RegisterSpriteClickEventHandler(new SpriteClickEventHandler(this.OnGoClick)); + } + + public bool OnCloseClicked(IXUIButton btn) + { + this.SetVisibleWithAnimation(false, null); + return true; + } + + public void OnGoClick(IXUISprite btn) + { + XSingleton.singleton.LastNpc = XSingleton.singleton.GetNpc(this.npcID); + this.SetVisibleWithAnimation(false, null); + } + + protected override void OnShow() + { + base.OnShow(); + base.uiBehaviour.m_Tex.SetTexturePath(this.tex); + } + + protected override void OnHide() + { + base.uiBehaviour.m_Tex.SetTexturePath(""); + base.OnHide(); + } + + protected override void OnUnload() + { + base.OnUnload(); + } + } +} -- cgit v1.1-26-g67d0