Exemplo n.º 1
0
 void Carry(string name, GameObject go)
 {
     if (name == DialogB.name)
     {
         DialogB.SetActive(false);
         DialogB.SetActive(true);
         SoundPlayer.Play("Cursor1");
         Msg.Remove(Msg[0]);
     }
     if (name == "ATK")
     {
         BattleStep = 1;
         SkillInfoController Si;
         for (int i = 0; i < 3; i++)
         {
             Si       = SkillBoard.transform.Find("Skill" + (i + 1)).GetComponent <SkillInfoController>();
             Si.BindS = SkillManager.S.Find(m => m.Name == Rounds[0].BindMember.Magics[i]);
             Si.UpdateInfo();
             SkillBoard.transform.Find("InfoText").GetComponent <Text>().text =
                 "MP  " + Rounds[0].BindMember.MP + " / " + Rounds[0].BindMember.MaxMP;
         }
         string TeamStr = "", HColor = "";
         for (int i = 0; i < F1.Count; i++)
         {
             float f = F1[i].BindMember.HP / F1[i].BindMember.MaxHP;
             if (f >= 0.3f)
             {
                 HColor = "orange";
             }
             if (f < 0.3f)
             {
                 HColor = "red";
             }
             if (f >= 0.6f)
             {
                 HColor = "green";
             }
             TeamStr += F1[i].BindMember.Name + "     <color=" + HColor +
                        ">" + F1[i].BindMember.HP + " / " + F1[i].BindMember.MaxHP + "</color>\n";
         }
         SkillBoard.transform.Find("TeamText").GetComponent <Text>().text = TeamStr;
     }
     if (name == "NextBtn")
     {
         //BattleStep = 2;
     }
     if (name == "PrevBtn")
     {
         Debug.Log("Prev");
         BattleStep = 1;
     }
     if (name.StartsWith("Team") && name != "TeamText")
     {
         List <FighterController> lt = F2;
         if (lSk.Strength >= 0)
         {
             lt = F2;
         }
         else
         {
             lt = F1;
         }
         tar = lt.Find(m => m.BindMember.Equals(go.GetComponent <TeamInfoController>().BindMember));
         Msg.Add(Rounds[0].BindMember.Name + "对" + tar.BindMember.Name + "使用了“" + lSk.Name + "”!");
         Rounds[0].State = FighterController.BattleState.Magic;
         BattleStep      = 3;
         ttick           = 0;
     }
     if (name.StartsWith("Skill") && name != "SkillBoard")
     {
         //Debug.Log("Skill?");
         List <FighterController> lt = F2;
         SkillInfoController      Sk = SkillBoard.transform.Find(name).GetComponent <SkillInfoController>();
         SkillManager.Skill       sk = Sk.BindS;
         if (sk.MP > Rounds[0].BindMember.MP)
         {
             MessageCreator.CreateMsg("魔力不足", "你无法使用这个魔法。");
             return;
         }
         lSk = sk;
         //Debug.Log(Sk.name);
         if (lSk.Strength >= 0)
         {
             lt = F2.FindAll(m => m.BindMember.HP > 0);
         }
         else
         {
             lt = F1.FindAll(m => m.BindMember.HP > 0);
         }
         for (int i = 0; i < 4; i++)
         {
             if (i >= lt.Count)
             {
                 Teams[i].SetActive(false);
             }
             else
             {
                 Teams[i].SetActive(true);
                 Teams[i].GetComponent <TeamInfoController>().BindMember = lt[i].BindMember;
                 Teams[i].GetComponent <TeamInfoController>().UpdateInfo();
             }
         }
         BattleStep = 2;
     }
 }
Exemplo n.º 2
0
 private void Awake()
 {
     skillInfoController = new SkillInfoController(this, this);
 }