From 6eb915c129fc90c6f4c82ae097dd6ffad5239efc Mon Sep 17 00:00:00 2001 From: chai Date: Mon, 25 Jan 2021 14:28:30 +0800 Subject: +scripts --- .../XMainClient/LevelRewardBigMeleeHandler.cs | 105 +++++++++++++++++++++ 1 file changed, 105 insertions(+) create mode 100644 Client/Assets/Scripts/XMainClient/LevelRewardBigMeleeHandler.cs (limited to 'Client/Assets/Scripts/XMainClient/LevelRewardBigMeleeHandler.cs') diff --git a/Client/Assets/Scripts/XMainClient/LevelRewardBigMeleeHandler.cs b/Client/Assets/Scripts/XMainClient/LevelRewardBigMeleeHandler.cs new file mode 100644 index 00000000..9178717f --- /dev/null +++ b/Client/Assets/Scripts/XMainClient/LevelRewardBigMeleeHandler.cs @@ -0,0 +1,105 @@ +using System; +using UILib; +using XMainClient.UI; +using XUtliPoolLib; + +namespace XMainClient +{ + internal class LevelRewardBigMeleeHandler : DlgHandlerBase + { + protected override string FileName + { + get + { + return "Battle/LevelReward/LevelRewardBigMeleeFrame"; + } + } + + private XLevelRewardDocument doc = null; + + private XBigMeleeEntranceDocument entDoc = null; + + private IUIDummy m_snapshot; + + private uint m_show_time_token = 0u; + + private IXUISprite m_Return; + + private IXUILabel m_RankNum; + + private IXUISprite m_RankImg; + + private IXUILabel m_Score; + + private IXUILabel m_Kill; + + private IXUILabel m_Death; + + private IXUIButton m_BattleData; + + protected override void Init() + { + base.Init(); + this.doc = XDocuments.GetSpecificDocument(XLevelRewardDocument.uuID); + this.entDoc = XDocuments.GetSpecificDocument(XBigMeleeEntranceDocument.uuID); + this.m_Return = (base.PanelObject.transform.Find("Return").GetComponent("XUISprite") as IXUISprite); + this.m_RankImg = (base.PanelObject.transform.Find("Rank/RankImg").GetComponent("XUISprite") as IXUISprite); + this.m_RankNum = (base.PanelObject.transform.Find("Rank/RankNum").GetComponent("XUILabel") as IXUILabel); + this.m_Score = (base.PanelObject.transform.Find("Result/Score/T").GetComponent("XUILabel") as IXUILabel); + this.m_Kill = (base.PanelObject.transform.Find("Result/Kill/T").GetComponent("XUILabel") as IXUILabel); + this.m_Death = (base.PanelObject.transform.Find("Result/Death/T").GetComponent("XUILabel") as IXUILabel); + this.m_BattleData = (base.PanelObject.transform.Find("ItemList/BattleData").GetComponent("XUIButton") as IXUIButton); + this.m_snapshot = (base.PanelObject.transform.Find("Snapshot/Snapshot").GetComponent("UIDummy") as IUIDummy); + } + + public override void RegisterEvent() + { + base.RegisterEvent(); + this.m_Return.RegisterSpriteClickEventHandler(new SpriteClickEventHandler(this.OnReturnClicked)); + this.m_BattleData.RegisterClickEventHandler(new ButtonClickEventHandler(this.OnRankClicked)); + } + + private void OnReturnClicked(IXUISprite sp) + { + this.doc.SendLeaveScene(); + } + + private bool OnRankClicked(IXUIButton btn) + { + DlgHandlerBase.EnsureCreate(ref this.entDoc.RankHandler, base.transform, true, null); + this.entDoc.RankHandler.SetType(true); + return true; + } + + protected override void OnShow() + { + base.OnShow(); + this.OnShowUI(); + } + + public override void OnUnload() + { + XSingleton.singleton.OnUIUnloadMainDummy(this.m_snapshot); + DlgHandlerBase.EnsureUnload(ref this.entDoc.RankHandler); + base.OnUnload(); + } + + private void OnShowUI() + { + XLevelRewardDocument.BigMeleeData bigMeleeBattleData = this.doc.BigMeleeBattleData; + this.m_Score.SetText(bigMeleeBattleData.score.ToString()); + this.m_Kill.SetText(bigMeleeBattleData.kill.ToString()); + this.m_Death.SetText(bigMeleeBattleData.death.ToString()); + XSingleton.singleton.ShowRank(this.m_RankImg, this.m_RankNum, (int)bigMeleeBattleData.rank); + XSingleton.singleton.EnableMainDummy(true, this.m_snapshot); + float interval = XSingleton.singleton.SetMainAnimationGetLength(XSingleton.singleton.Player.Present.PresentLib.Disappear); + this.m_show_time_token = XSingleton.singleton.SetTimer(interval, new XTimerMgr.ElapsedEventHandler(this.KillDummyTimer), null); + } + + private void KillDummyTimer(object sender) + { + XSingleton.singleton.KillTimer(this.m_show_time_token); + XSingleton.singleton.SetMainAnimation(XSingleton.singleton.Player.Present.PresentLib.AttackIdle); + } + } +} -- cgit v1.1-26-g67d0