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/GuildPassMgr.cs | 113 ++++++++++++++++++++++ 1 file changed, 113 insertions(+) create mode 100644 Client/Assets/Scripts/XMainClient/GuildPassMgr.cs (limited to 'Client/Assets/Scripts/XMainClient/GuildPassMgr.cs') diff --git a/Client/Assets/Scripts/XMainClient/GuildPassMgr.cs b/Client/Assets/Scripts/XMainClient/GuildPassMgr.cs new file mode 100644 index 00000000..35666e3a --- /dev/null +++ b/Client/Assets/Scripts/XMainClient/GuildPassMgr.cs @@ -0,0 +1,113 @@ +using System; +using System.Collections.Generic; +using KKSG; +using UnityEngine; +using XMainClient.UI; +using XMainClient.UI.UICommon; +using XUtliPoolLib; + +namespace XMainClient +{ + internal class GuildPassMgr : XSingleton + { + public Dictionary attachDic; + + private const int cnt = 6; + + public bool isOpen = false; + + public GameObject m_wait_blue; + + public GameObject m_wait_red; + + public void InitBoard() + { + bool flag = this.attachDic == null; + if (flag) + { + this.attachDic = new Dictionary(); + } + this.ClearAll(); + this.isOpen = false; + for (uint num = 0u; num < 6u; num += 1u) + { + uint num2 = num + 1u; + GameObject gameObject = GameObject.Find("guadian/board" + num2); + GuildPassBoard guildPassBoard = gameObject.AddComponent(); + uint sceneid = XGuildTerritoryDocument.mGuildTransfer.GetByid(num2).sceneid; + guildPassBoard.Init(num2, sceneid, gameObject); + this.attachDic.Add(num2, guildPassBoard); + } + for (uint num3 = 0u; num3 < 6u; num3 += 1u) + { + uint num4 = num3 + 6u + 1u; + GameObject gameObject2 = GameObject.Find("guadian/board" + num4); + GuildPassBoard guildPassBoard2 = gameObject2.AddComponent(); + uint sceneid2 = XGuildTerritoryDocument.mGuildTransfer.GetByid(num4).sceneid; + guildPassBoard2.Init(num4, sceneid2, gameObject2); + this.attachDic.Add(num4, guildPassBoard2); + } + this.m_wait_blue = GameObject.Find("DynamicScene/wait_scene/wait_blue"); + this.m_wait_red = GameObject.Find("DynamicScene/wait_scene/wait_red"); + } + + public void UpdateInfo(List infos) + { + bool flag = infos != null; + if (flag) + { + for (int i = 0; i < infos.Count; i++) + { + foreach (KeyValuePair keyValuePair in this.attachDic) + { + bool flag2 = keyValuePair.Value.sceneid == infos[i].mapid; + if (flag2) + { + keyValuePair.Value.UpdateBoard(infos[i]); + this.isOpen = infos[i].isopen; + } + } + } + bool flag3 = this.m_wait_red != null && this.m_wait_blue != null; + if (flag3) + { + this.m_wait_blue.SetActive(!this.isOpen); + this.m_wait_red.SetActive(!this.isOpen); + } + bool flag4 = DlgBase.singleton.IsVisible(); + if (flag4) + { + bool flag5 = DlgBase.singleton.m_miniReportHandler != null; + if (flag5) + { + DlgBase.singleton.m_miniReportHandler.ShowPrepare(!this.isOpen); + DlgBase.singleton.m_miniReportHandler.ShowBegin(this.isOpen); + } + } + } + } + + public void OpenAll() + { + foreach (KeyValuePair keyValuePair in this.attachDic) + { + keyValuePair.Value.UpdateOpenState(true); + } + } + + public void ClearAll() + { + bool flag = this.attachDic != null; + if (flag) + { + foreach (KeyValuePair keyValuePair in this.attachDic) + { + keyValuePair.Value.ResetOpenState(); + keyValuePair.Value.DestroyGameObjects(); + UnityEngine.Object.Destroy(keyValuePair.Value); + } + this.attachDic.Clear(); + } + } + } +} -- cgit v1.1-26-g67d0