//节点信息 public void pointStatus() { if (magic.getPointBroked(int.Parse(this.tag))) { //this.GetComponent<SpriteRenderer>().sprite = mySprite; this.transform.GetChild(0).GetComponent <TextMesh>().text = null; } }
// Update is called once per frame void Update() { //判断状态,确定节点是否显示,以及其魔力值等 if (magic.getPoint(id).MaxMagic == 0) { spriteRenderer.sprite = null; } else if (!magic.getPointBroked(id)) { textMesh.text = magic.getPoint(id).MaxMagic.ToString(); } //节点颜色初始化 spriteRenderer.color = toPointColor(magic.getPointColor(id)); }
// Update is called once per frame void Update() { //判断状态,确定节点是否显示,以及其魔力值等 if (magic.getPoint(id).MaxMagic == 0) { Color color = toPointColor(magic.getPointColor(id)); spriteRenderer.color = new Color(color.r, color.g, color.b, 0.5f); } else if (!magic.getPointBroked(id)) { spriteRenderer.color = toPointColor(magic.getPointColor(id)); textMesh.text = magic.getPoint(id).MaxMagic.ToString(); } //节点颜色初始化 }
// 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; } }
// Update is called once per frame void Update() { magic = MagicCore.Instance; pList = magic.getPoint(); //判断状态,确定节点是否显示,以及其魔力值等 if (magic.getPoint(int.Parse(this.tag)).MaxMagic == 0) { this.GetComponent <SpriteRenderer>().sprite = null; } else if (!magic.getPointBroked(int.Parse(this.tag))) { this.transform.GetChild(0).GetComponent <TextMesh>().text = magic.getPoint(int.Parse(this.tag)).magic.ToString(); if (magic.getPoint(int.Parse(this.tag)).isProtected) { this.transform.GetChild(0).GetComponent <TextMesh>().color = Color.blue; } else { this.transform.GetChild(0).GetComponent <TextMesh>().color = Color.white; } this.GetComponent <SpriteRenderer>().sprite = oldSprite; } pointStatus(); //节点颜色初始化 this.GetComponent <SpriteRenderer>().color = toPointColor(magic.getPointColor(int.Parse(this.tag))); if (magic.getPoint(int.Parse(this.tag)).isActivity) { if (magic.getPointColor(int.Parse(this.tag)) == PointColor.black) { this.transform.GetChild(1).localScale = new Vector3(0.05f, 0.05f, 0); } if (magic.getPointColor(int.Parse(this.tag)) == PointColor.blue) { this.transform.GetChild(2).localScale = new Vector3(0.05f, 0.05f, 0); } if (magic.getPointColor(int.Parse(this.tag)) == PointColor.red) { this.transform.GetChild(3).localScale = new Vector3(0.05f, 0.05f, 0); } if (magic.getPointColor(int.Parse(this.tag)) == PointColor.white) { this.transform.GetChild(4).localScale = new Vector3(0.05f, 0.05f, 0); } if (magic.getPointColor(int.Parse(this.tag)) == PointColor.yellow) { this.transform.GetChild(5).localScale = new Vector3(0.05f, 0.05f, 0); } } else { this.transform.GetChild(1).localScale = new Vector3(0, 0, 0); this.transform.GetChild(2).localScale = new Vector3(0, 0, 0); this.transform.GetChild(3).localScale = new Vector3(0, 0, 0); this.transform.GetChild(4).localScale = new Vector3(0, 0, 0); this.transform.GetChild(5).localScale = new Vector3(0, 0, 0); } if (magic.isDefencer(int.Parse(this.tag))) { this.GetComponent <SpriteRenderer>().color = Color.gray; } if (magic.getFlag() != ClickFlag.wait) { ////当前节点变大 //if (magic.getPos() == int.Parse(this.tag)) // this.transform.localScale = new Vector3(3, 3, 0); //else // this.transform.localScale = new Vector3(2, 2, 0); } //空白处按右键,取消所有操作 if (Input.GetMouseButton(1) && Clickcontrol.isDrag) { magic.RclickP(-1); Clickcontrol.isDrag = false; } }