/// <summary> /// 经验条滚动 /// </summary> void OnSecondFunction() { exp -= 10; counts++; UI_HeroDetail.instance.NameArea.ChangeExpBar(1f * counts / hd.maxExps, Mathf.CeilToInt((1f * counts / hd.maxExps) * hd.maxExps), hd.maxExps, hd.lvl); if ((1f * counts / hd.maxExps) >= 1f) { counts = 0; hd.lvl++; hd.RefreshAttr(); //hd.fc = HeroData.GetFC(hd); upGradelvl++; hd.maxExps = VOManager.Instance().GetCSV <HeroUpgradeCSV>("HeroUpgrade").GetVO(hd.lvl).exp; UI_HeroDetail.instance.NameArea.ChangeExpBar(0, exp, hd.maxExps, hd.lvl); if (hd.lvl >= playerNode.heroLvLimit) { ItemBottlList.Instance().StopEatDrug(); hd.exps = 0; UI_HeroDetail.instance.NameArea.ChangeExpBar(0, hd.exps, hd.maxExps, hd.lvl); CancelInvoke("EatDrug"); CancelInvoke("OnSecondFunction"); } } if (exp < 1) { hd.exps = counts; CancelInvoke("OnSecondFunction"); ItemBottlList.Instance().StopEatDrug(); } }