IEnumerator ReviveTimer(NationBattleTeam teamData, TeamLockNode lockNode) { while (teamData.RealState != eTeamState.Available) { yield return(null); } DisableDrag(teamData.Name, true); lockNode.LockRootGO.SetActive(false); lockNode.DeathGO.SetActive(false); lockNode.InTheWarGO.SetActive(false); }
public override void Awake() { base.Awake(); var t = controller.transform; DynamicScroll = t.GetMonoILRComponent <CombatPartnerDynamicScroll>("Content/Bottom/BuddyList/Placeholder/PartnerGrid"); SelectLight = t.FindEx("BG/Light").gameObject; DragZ = -2; CurDragItem = t.GetMonoILRComponentByClassPath <NationPartnerItem>("Content/Formation/DragDropContainer/Template", "Hotfix_LT.UI.NationPartnerItem"); controller.backButton = t.GetComponent <UIButton>("Content/UINormalFrameBG/CancelBtn"); controller.hudRoot = t.GetComponent <Transform>("Content/Bottom/BuddyList"); TeamLockNodes = new TeamLockNode[3]; TeamLockNodes[0] = new TeamLockNode(); TeamLockNodes[0].Name = "nation1"; TeamLockNodes[0].LockRootGO = t.FindEx("Content/Formation/TeamList/nation1/LockRoot").gameObject; TeamLockNodes[1] = new TeamLockNode(); TeamLockNodes[1].Name = "nation2"; TeamLockNodes[1].LockRootGO = t.FindEx("Content/Formation/TeamList/nation2/LockRoot").gameObject; TeamLockNodes[2] = new TeamLockNode(); TeamLockNodes[2].Name = "nation3"; TeamLockNodes[2].LockRootGO = t.FindEx("Content/Formation/TeamList/nation3/LockRoot").gameObject; FormationPartnerItems = new List <NationPartnerItem>(); FormationPartnerItems.Add(t.GetMonoILRComponentByClassPath <NationPartnerItem>("Content/Formation/TeamList/nation1/PartnerUIGrid/0_Pos", "Hotfix_LT.UI.NationPartnerItem")); FormationPartnerItems.Add(t.GetMonoILRComponentByClassPath <NationPartnerItem>("Content/Formation/TeamList/nation1/PartnerUIGrid/0_Pos (1)", "Hotfix_LT.UI.NationPartnerItem")); FormationPartnerItems.Add(t.GetMonoILRComponentByClassPath <NationPartnerItem>("Content/Formation/TeamList/nation1/PartnerUIGrid/0_Pos (2)", "Hotfix_LT.UI.NationPartnerItem")); FormationPartnerItems.Add(t.GetMonoILRComponentByClassPath <NationPartnerItem>("Content/Formation/TeamList/nation1/PartnerUIGrid/0_Pos (3)", "Hotfix_LT.UI.NationPartnerItem")); FormationPartnerItems.Add(t.GetMonoILRComponentByClassPath <NationPartnerItem>("Content/Formation/TeamList/nation2/PartnerUIGrid/0_Pos", "Hotfix_LT.UI.NationPartnerItem")); FormationPartnerItems.Add(t.GetMonoILRComponentByClassPath <NationPartnerItem>("Content/Formation/TeamList/nation2/PartnerUIGrid/0_Pos (1)", "Hotfix_LT.UI.NationPartnerItem")); FormationPartnerItems.Add(t.GetMonoILRComponentByClassPath <NationPartnerItem>("Content/Formation/TeamList/nation2/PartnerUIGrid/0_Pos (2)", "Hotfix_LT.UI.NationPartnerItem")); FormationPartnerItems.Add(t.GetMonoILRComponentByClassPath <NationPartnerItem>("Content/Formation/TeamList/nation2/PartnerUIGrid/0_Pos (3)", "Hotfix_LT.UI.NationPartnerItem")); FormationPartnerItems.Add(t.GetMonoILRComponentByClassPath <NationPartnerItem>("Content/Formation/TeamList/nation3/PartnerUIGrid/0_Pos", "Hotfix_LT.UI.NationPartnerItem")); FormationPartnerItems.Add(t.GetMonoILRComponentByClassPath <NationPartnerItem>("Content/Formation/TeamList/nation3/PartnerUIGrid/0_Pos (1)", "Hotfix_LT.UI.NationPartnerItem")); FormationPartnerItems.Add(t.GetMonoILRComponentByClassPath <NationPartnerItem>("Content/Formation/TeamList/nation3/PartnerUIGrid/0_Pos (2)", "Hotfix_LT.UI.NationPartnerItem")); FormationPartnerItems.Add(t.GetMonoILRComponentByClassPath <NationPartnerItem>("Content/Formation/TeamList/nation3/PartnerUIGrid/0_Pos (3)", "Hotfix_LT.UI.NationPartnerItem")); t.GetComponent <UIButton>("Content/Bottom/Title/BtnList/AllBtn").onClick.Add(new EventDelegate(() => OnRaceTabClick(t.FindEx("Content/Bottom/Title/BtnList/AllBtn").gameObject))); t.GetComponent <UIButton>("Content/Bottom/Title/BtnList/FengBtn").onClick.Add(new EventDelegate(() => OnRaceTabClick(t.FindEx("Content/Bottom/Title/BtnList/FengBtn").gameObject))); t.GetComponent <UIButton>("Content/Bottom/Title/BtnList/HuoBtn").onClick.Add(new EventDelegate(() => OnRaceTabClick(t.FindEx("Content/Bottom/Title/BtnList/HuoBtn").gameObject))); t.GetComponent <UIButton>("Content/Bottom/Title/BtnList/ShuiBtn").onClick.Add(new EventDelegate(() => OnRaceTabClick(t.FindEx("Content/Bottom/Title/BtnList/ShuiBtn").gameObject))); t.GetComponent <UIButton>("Content/Formation/TeamList/nation1/LockRoot").onClick.Add(new EventDelegate(() => OnClickTeam(t.FindEx("Content/Formation/TeamList/nation1").gameObject))); t.GetComponent <UIButton>("Content/Formation/TeamList/nation2/LockRoot").onClick.Add(new EventDelegate(() => OnClickTeam(t.FindEx("Content/Formation/TeamList/nation2").gameObject))); t.GetComponent <UIButton>("Content/Formation/TeamList/nation3/LockRoot").onClick.Add(new EventDelegate(() => OnClickTeam(t.FindEx("Content/Formation/TeamList/nation3").gameObject))); }
void SetTeamState() { int DeathTeamCount = 0; int AllDeath = 3; bool hasTeamStartAction = false; NationBattleTeam[] teamDatas = new NationBattleTeam[TeamLockNodes.Length]; for (int i = 0; i < TeamLockNodes.Length; i++) { TeamLockNode teamNode = TeamLockNodes[i]; EB.Debug.LogError(teamNode.Name); NationBattleTeam teamData = NationManager.Instance.Account.FindTeam(teamNode.Name); teamDatas[i] = teamData; if (teamData.RealState == eTeamState.InTheWar || teamData.RealState == eTeamState.Death || teamData.RealState == eTeamState.Arrive) { DeathTeamCount++; DisableDrag(teamData.Name, false); hasTeamStartAction = true; //当已知有队伍出征的前提下,不能进行上下阵操作 //teamNode.LockRootGO.SetActive(true); //teamNode.DeathGO.SetActive(false); //teamNode.InTheWarGO.SetActive(true); //不再进行单独计时 //if (!ReviveCoroutineDic.ContainsKey(teamData.Name)) // ReviveCoroutineDic.Add(teamData.Name, StartCoroutine(ReviveTimer(teamData, teamNode))); //else if (ReviveCoroutineDic[teamData.Name] != null) //{ // StopCoroutine(ReviveCoroutineDic[teamData.Name]); // ReviveCoroutineDic[teamData.Name] = StartCoroutine(ReviveTimer(teamData, teamNode)); //} //else // ReviveCoroutineDic[teamData.Name] = StartCoroutine(ReviveTimer(teamData, teamNode)); } else { DisableDrag(teamData.Name, true); teamNode.LockRootGO.SetActive(false); //teamNode.DeathGO.SetActive(false); //teamNode.InTheWarGO.SetActive(false); } } if (hasTeamStartAction) { for (int i = 0; i < TeamLockNodes.Length; i++) { TeamLockNode teamNode = TeamLockNodes[i]; NationBattleTeam teamData = NationManager.Instance.Account.FindTeam(teamNode.Name); DisableDrag(teamData.Name, false); TeamLockNodes[i].LockRootGO.SetActive(true); } } if (DeathTeamCount >= AllDeath) { for (int i = 0; i < teamDatas.Length; i++) { StartCoroutine(ReviveTimer(teamDatas[i], TeamLockNodes[i])); } } }