Ejemplo n.º 1
0
    //下一轮开会投票
    public void NextVote()
    {
        CheckVoteStatus();
        SkillConfirmButton.SetActive(false);
        for (int i = 0; i < VoteStrs.Count; i++)
        {
            if (VoteStrs[i].Active == true)
            {
                TempStrs.Add(VoteStrs[i].Str);
                StrInfos.Remove(VoteStrs[i].TargetStr);//在待激活面板中删除对应战略
            }
            Destroy(VoteStrs[i].TargetStr.gameObject);
            Destroy(VoteStrs[i].gameObject);
        }
        VoteStrs.Clear();

        if (VoteSeqNum == 3)
        {
            VoteSeqNum = 0;
        }
        else
        {
            VoteSeqNum += 1;
            if (VoteSeqNum == 3)
            {
                VoteSeqNum += 1;
            }
        }

        if (VoteSeqNum < 5)
        {
            StartVote();
        }
        else
        {
            for (int i = 0; i < TempStrs.Count; i++)
            {
                StrategyInfo NewStr = Instantiate(ActivePrefab, ActiveStrsContent);
                NewStr.SC  = this;
                NewStr.Str = TempStrs[i];
                NewStr.UpdateUI();
                NewStr.Str.Effect(GC);
                ActiveStrs.Add(NewStr);
            }
            MeetingButton.interactable = false;
            TempStrs.Clear();
            TimeLeft = 384;
            if (CultureTimeLeft == -1)
            {
                CultureTimeLeft = 1152;
            }
            UpdateUI();
            VotePanel.gameObject.SetActive(false);
        }
    }
Ejemplo n.º 2
0
 public void SkillStrSelect(StrategyInfo sStr, bool add)
 {
     if (add == true)
     {
         VoteSelectStrs.Add(sStr);
         if (VoteSelectStrs.Count >= StrSelectNum)
         {
             for (int i = 0; i < VoteStrs.Count; i++)
             {
                 VoteStrs[i].StrSelectToggle.interactable = false;
             }
         }
     }
     else
     {
         if (VoteSelectStrs.Contains(sStr))
         {
             VoteSelectStrs.Remove(sStr);
         }
         if (VoteSelectStrs.Count >= StrSelectNum)
         {
             for (int i = 0; i < VoteStrs.Count; i++)
             {
                 VoteStrs[i].StrSelectToggle.interactable = true;
             }
         }
     }
     if (VoteSelectStrs.Count > 0)
     {
         SkillConfirmButton.SetActive(true);
     }
     else
     {
         SkillConfirmButton.SetActive(false);
     }
 }