/// <summary> /// 属性加成 /// </summary> /// <param name="go"></param> void OnAddPropertyBtn(GameObject go) { if (propertyObj != null) { propertyObj.gameObject.SetActive(true); } if (CheckIfHaveMount()) { return; } //如果玩家没有幻兽 for (int i = 0; i < curPropertyLab.Count; i++) { curPropertyLab[i].text = "0"; } SkinPropertyRef nextInfo = ConfigMng.Instance.GetSkinPropertyRef(1); if (nextInfo != null) { for (int i = 0; i < nextLevAddLab.Count; i++) { nextLevAddLab[i].text = (nextInfo.attr[i]).ToString(); } } }
//判断玩家是否有幻兽 bool CheckIfHaveMount() { SkinPropertyRef curPro = null; SkinPropertyRef nextInfo = null; int lev = GameCenter.newMountMng.curSkinLev; int exp = GameCenter.newMountMng.skinExp; if (lev >= ConfigMng.Instance.SkinPropertyRefTable.Count) { lev = ConfigMng.Instance.SkinPropertyRefTable.Count; curPro = ConfigMng.Instance.GetSkinPropertyRef(lev - 1); nextInfo = curPro; exp = nextInfo.exp; } if (mountInfoDic.Count > 0) { if (levLab != null) { levLab.text = "Lv:" + GameCenter.newMountMng.curSkinLev.ToString(); } if (curPro == null) { curPro = ConfigMng.Instance.GetSkinPropertyRef(lev); } if (curPro != null) { if (curPropertyLab.Count > 0) { for (int i = 0; i < curPropertyLab.Count; i++) { curPropertyLab[i].text = curPro.attr[i].ToString(); } } } //下级等级属性 if (nextLevAddLab.Count > 0) { nextInfo = ConfigMng.Instance.GetSkinPropertyRef(lev + 1); if (nextInfo != null) { if (expSli != null) { expSli.value = (float)exp / nextInfo.exp; } if (expLab != null) { expLab.text = exp + "/" + nextInfo.exp; } for (int i = 0; i < nextLevAddLab.Count; i++) { if (curPro != null) { nextLevAddLab[i].text = (nextInfo.attr[i] - curPro.attr[i]).ToString(); } else { nextLevAddLab[i].text = (nextInfo.attr[i]).ToString(); } } } } //Debug.Log("判断玩家是否有幻兽 curSkinLev : " + GameCenter.newMountMng.curSkinLev + " , skinExp : " + GameCenter.newMountMng.skinExp + // " , SkinPropertyRefTable : " + ConfigMng.Instance.SkinPropertyRefTable.Count + " ,nextInfoid : " + nextInfo.level + " , exp : " + nextInfo.exp); return(true); } return(false); }