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 void OnClickTeam(GameObject teamNode) { NationBattleTeam teamData = NationManager.Instance.Account.FindTeam(teamNode.name); switch (teamData.RealState) { case eTeamState.InTheWar: MessageTemplateManager.ShowMessage(eMessageUIType.FloatingText, EB.Localizer.GetString("ID_codefont_in_NationBattleFormationController_2158")); break; case eTeamState.Death: case eTeamState.Arrive: MessageTemplateManager.ShowMessage(eMessageUIType.FloatingText, EB.Localizer.GetString("ID_codefont_in_NationBattleFormationController_2347")); break; default: EB.Debug.LogError("Click Error for this team"); break; } }
public void Fill(NationBattleTeam teamData) { mTeamData = teamData; if (teamData.RealState == eTeamState.Empty) { GoOnButton.GetComponent <UISprite>().color = Color.magenta; GoOnButton.isEnabled = false; GoOnButton.gameObject.CustomSetActive(false); UILabel uilabel = OffBtn.GetComponentInChildren <UILabel>(); LTUIUtil.SetText(uilabel, EB.Localizer.GetString("ID_codefont_in_NationBattleSelectTeamCell_710")); OffBtn.gameObject.CustomSetActive(true); Mask.gameObject.CustomSetActive(false); } else if (mTeamData.RealState == eTeamState.InTheWar) { GoOnButton.GetComponent <UISprite>().color = Color.magenta; GoOnButton.isEnabled = false; GoOnButton.gameObject.CustomSetActive(true); UILabel uilabel = GoOnButton.GetComponentInChildren <UILabel>(); LTUIUtil.SetText(uilabel, EB.Localizer.GetString("ID_codefont_in_NationBattleSelectTeamCell_1019")); OffBtn.gameObject.CustomSetActive(false); Mask.gameObject.CustomSetActive(false); } else if (mTeamData.RealState == eTeamState.Available) { GoOnButton.GetComponent <UISprite>().color = Color.white; GoOnButton.gameObject.CustomSetActive(true); GoOnButton.isEnabled = true; OffBtn.gameObject.CustomSetActive(false); Mask.gameObject.CustomSetActive(false); } else if (mTeamData.RealState == eTeamState.Death || mTeamData.RealState == eTeamState.Arrive) { UILabel uilabel = OffBtn.GetComponentInChildren <UILabel>(); LTUIUtil.SetText(uilabel, EB.Localizer.GetString("ID_codefont_in_NationBattleSelectTeamCell_1567")); GoOnButton.GetComponent <UISprite>().color = Color.magenta; GoOnButton.gameObject.CustomSetActive(false); OffBtn.gameObject.CustomSetActive(true); Mask.gameObject.CustomSetActive(true); } }
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])); } } }