From 6eb915c129fc90c6f4c82ae097dd6ffad5239efc Mon Sep 17 00:00:00 2001 From: chai Date: Mon, 25 Jan 2021 14:28:30 +0800 Subject: +scripts --- .../XMainClient/Team/XTeamLeagueLoadingView.cs | 141 +++++++++++++++++++++ 1 file changed, 141 insertions(+) create mode 100644 Client/Assets/Scripts/XMainClient/Team/XTeamLeagueLoadingView.cs (limited to 'Client/Assets/Scripts/XMainClient/Team/XTeamLeagueLoadingView.cs') diff --git a/Client/Assets/Scripts/XMainClient/Team/XTeamLeagueLoadingView.cs b/Client/Assets/Scripts/XMainClient/Team/XTeamLeagueLoadingView.cs new file mode 100644 index 00000000..ffa07893 --- /dev/null +++ b/Client/Assets/Scripts/XMainClient/Team/XTeamLeagueLoadingView.cs @@ -0,0 +1,141 @@ +using System; +using KKSG; +using UILib; +using UnityEngine; +using XMainClient.UI.UICommon; +using XUtliPoolLib; + +namespace XMainClient +{ + internal class XTeamLeagueLoadingView : DlgBase + { + public override string fileName + { + get + { + return "Battle/TeamLeagueLoading"; + } + } + + public override int layer + { + get + { + return 1; + } + } + + public override bool autoload + { + get + { + return true; + } + } + + public bool IsLoadingOver + { + get + { + return this._isLoadingOver; + } + } + + public override bool needOnTop + { + get + { + return true; + } + } + + private XTeamLeagueBattleDocument _doc; + + private bool _isLoadingOver = false; + + protected override void Init() + { + base.Init(); + this._isLoadingOver = false; + this._doc = XDocuments.GetSpecificDocument(XTeamLeagueBattleDocument.uuID); + } + + public void ShowPkLoading() + { + this.SetVisible(true, true); + } + + protected override void OnShow() + { + base.OnShow(); + this.LoadingOver(null); + this.SetBattleInfo(); + } + + private void LoadingOver(object o) + { + this._isLoadingOver = true; + } + + private void SetMemberInfo(GameObject member, LeagueBattleRoleBrief info) + { + bool flag = info == null; + if (!flag) + { + IXUILabel ixuilabel = member.transform.Find("Level").GetComponent("XUILabel") as IXUILabel; + IXUISprite ixuisprite = member.transform.Find("Avatar").GetComponent("XUISprite") as IXUISprite; + IXUISprite ixuisprite2 = member.transform.Find("Profession").GetComponent("XUISprite") as IXUISprite; + IXUILabel ixuilabel2 = member.transform.Find("Name").GetComponent("XUILabel") as IXUILabel; + IXUILabel ixuilabel3 = member.transform.Find("PPT").GetComponent("XUILabel") as IXUILabel; + ixuilabel.SetText(info.level.ToString()); + ixuisprite2.SetSprite(XSingleton.singleton.GetProfIcon((int)info.profession)); + ixuisprite.SetSprite(XSingleton.singleton.GetProfHeadIcon((int)info.profession)); + ixuilabel2.SetText(info.name); + ixuilabel3.SetText(info.pkpoint.ToString()); + } + } + + private void SetTeamInfo(int index, LeagueBattleTeamData BattleTeam) + { + bool flag = BattleTeam == null; + if (!flag) + { + base.uiBehaviour.m_TeamName[index].SetText(BattleTeam.name); + base.uiBehaviour.m_TeamRegion[index].SetText(BattleTeam.servername); + base.uiBehaviour.m_MembersPool[index].FakeReturnAll(); + for (int i = 0; i < BattleTeam.members.Count; i++) + { + GameObject gameObject = base.uiBehaviour.m_MembersPool[index].FetchGameObject(false); + this.SetMemberInfo(gameObject, BattleTeam.members[i]); + bool flag2 = i < base.uiBehaviour.m_RightMemberNode.Count; + if (flag2) + { + gameObject.transform.parent = ((index == 0) ? base.uiBehaviour.m_LeftMemberNode[i] : base.uiBehaviour.m_RightMemberNode[i]); + } + gameObject.transform.localPosition = Vector3.zero; + } + base.uiBehaviour.m_MembersPool[index].ActualReturnAll(false); + } + } + + private void SetBattleInfo() + { + this.SetTeamInfo(0, this._doc.LoadingInfoBlue); + this.SetTeamInfo(1, this._doc.LoadingInfoRed); + } + + public void HidePkLoading() + { + bool flag = !base.IsVisible(); + if (!flag) + { + this.SetVisible(false, true); + } + } + + private void OnPkLoadingTweenFinish(IXUITweenTool tween) + { + this.SetVisible(false, true); + } + } +} -- cgit v1.1-26-g67d0