public void SetContent(FashionLevelRef cur, FashionLevelRef next = null) { if (cur != null) { for (int i = 0, max = attibute.Length; i < max; i++) { if (attibute[i] != null) { if (next != null) { SetLabelText(attibute[i], next.attr[i] - cur.attr[i]); } else { SetLabelText(attibute[i], cur.attr[i]); } } } } else { for (int i = 0, max = attibute.Length; i < max; i++) { if (next != null) { SetLabelText(attibute[i], next.attr[i]); } else { SetLabelText(attibute[i], 0); } } } }
/// <summary> /// 刷新时装等级 /// </summary> void RefreshFashionLev() { int lev = GameCenter.fashionMng.fashionLev; int count = ConfigMng.Instance.GetFashionLevelRefTable().Count - 1; if (lev >= count) { FashionLevelRef fashionLevelRef = ConfigMng.Instance.GetFashionLevelRef(count); fashionPro.value = 1; fashionLev.text = "LV." + lev.ToString(); fashionExp.text = GameCenter.fashionMng.fashionExp + " / " + GameCenter.fashionMng.fashionExp; if (levAttrObj != null) { levAttrObj.gameObject.SetActive(false); } leftAttrUi.SetContent(fashionLevelRef); rightAttrUi.SetContent(fashionLevelRef, fashionLevelRef); return; } else { FashionLevelRef fashionLevelRef = ConfigMng.Instance.GetFashionLevelRef(lev); FashionLevelRef nextFashionLevelRef = ConfigMng.Instance.GetFashionLevelRef(lev + 1); if (nextFashionLevelRef == null) { nextFashionLevelRef = fashionLevelRef; } if (fashionLevelRef != null) { fashionPro.value = (float)GameCenter.fashionMng.fashionExp / fashionLevelRef.exp; fashionLev.text = "LV." + lev.ToString(); fashionExp.text = GameCenter.fashionMng.fashionExp + " / " + fashionLevelRef.exp; if (levAttrObj != null) { levAttrObj.gameObject.SetActive(false); } leftAttrUi.SetContent(fashionLevelRef); rightAttrUi.SetContent(fashionLevelRef, nextFashionLevelRef); } } }