}//炼金阵,可用 public void TheUniversalnode() { int t = magiccore.getTurn(); int pos; Point p; pos = magiccore.getPos(); p = magiccore.getPoint(pos); if (doingbuff.count == t - 1) { p.magic += 1; magiccore.getPoint(pos).magic = p.magic; doingbuff.count += 1; } }//万用节点,可用
// Update is called once per frame void Update() { magic = MagicCore.Instance; pList = magic.getPoint(); pointStatus(); //判断状态,确定节点是否显示,以及其魔力值等 if (magic.getPoint(int.Parse(this.tag)).MaxMagic == 0) { this.GetComponent <SpriteRenderer>().sprite = null; } else if (!magic.getPointBroked(int.Parse(this.tag))) { this.GetComponentInChildren <TextMesh>().text = magic.getPoint(int.Parse(this.tag)).magic + "/" + magic.getPoint(int.Parse(this.tag)).MaxMagic; this.GetComponent <SpriteRenderer>().sprite = oldSprite; } //节点颜色初始化 this.GetComponent <SpriteRenderer>().color = toPointColor(magic.getPointColor(int.Parse(this.tag))); if (magic.isDefencer(int.Parse(this.tag))) { this.GetComponent <SpriteRenderer>().color = Color.gray; } //当前节点变大 if (magic.getPos() == int.Parse(this.tag)) { this.transform.localScale = new Vector3(5, 5, 0); } else { this.transform.localScale = new Vector3(3, 3, 0); } //空白处按右键,取消所有操作 if (Input.GetMouseButton(1) && Clickcontrol.isDrag) { magic.RclickP(-1); Clickcontrol.isDrag = false; } }
}//炼金阵,可用 public void TheUniversalnode() { int t = magiccore.getPos(); magiccore.getPoint(t).magic += 1; }//万用节点,可用
// Update is called once per frame void Update() { //显示ATK ATK.GetComponent <Text>().text = "ATK: " + magic.getATK().ToString(); HP.GetComponent <Text>().text = "HP:" + magic.getHP().ToString(); //测试monster,获取血量等 //monster0.GetComponentInChildren<Text>().text = monster0.GetComponent<Monster>().monsterHP.ToString(); //绘制连线颜色 drawLineColor(); //设定skill的内容 skillContent(); //设定skill的状态 skillStatus(); //检查线上的信息 lineStatus(); //设定节点位置指示器 mPosDetect.transform.position = pointGameObjectlist[magic.getPos()].transform.position; //监听函数 if (magic.getFlag() == ClickFlag.defencer) { startButton.GetComponent <Image>().color = Color.green; startButton.GetComponentInChildren <Text>().text = "冥想"; } else { startButton.GetComponent <Image>().color = Color.red; startButton.GetComponentInChildren <Text>().text = "防御"; } //检测怪物是否活着 for (int i = 0; i < 4; ++i) { if (magic.isMonsterLive(i)) { break; } if (i == 3 && !isShow) { Sprite nowSprite = new Sprite(); string[] lines = Itemtext.text.Split("\n"[0]); string englishName = null; for (int j = 0; j < lines.Length; ++j) { string[] parts = lines[j].Split(" "[0]); if (parts[1] == Ibuff.iName.ToString()) { englishName = parts[0]; break; } } //foreach (Sprite sp in LoadResources.Instance.itemSp.itemSprite) //{ // if (sp.name == englishName) // { // nowSprite = sp; // } //} nowSprite = LoadResources.Instance.itemSp.nameToSprite(englishName); gameOver.SetActive(true); GameObject.Find("tool").GetComponentInChildren <Text>().text = Ibuff.iName.ToString(); GameObject.Find("tool (1)").GetComponent <Image>().sprite = nowSprite; GameObject.Find("skill").GetComponentInChildren <Text>().text = sklist.name.ToString(); isShow = true; } } if (overCount == 0) { overCount = -1; MapMain.Instance.SceneEnd(true); canvas.SetActive(false); } //检测人物是否活着 if (magic.getHP() <= 0) { GameObject.Find("Death").transform.localScale = new Vector3(1, 1, 1); Destroy(GameObject.Find("Canvas")); magic.initMagic(); } //控制特效刷新 EFController.Instance.Update(); //道具查看与更新 itemupdate(); //更新buff buffupdate(); //刷新怪物血量 for (int i = 0; i < monsterList.transform.childCount; ++i) { if (magic.isMonsterLive(i)) { monsterList.transform.GetChild(i).GetComponentInChildren <Text>().text = magic.getMonsterList()[int.Parse(monsterList.transform.GetChild(i).name)].monsterHP.ToString(); } else { monsterList.transform.GetChild(i).GetComponentInChildren <Text>().text = "0"; } } }