public void RspStrong(GameMsg msg) { audioSev.PlayUIAudio(Constans.FBItem); int fight = NETCommon.GetFightByProps(GameRoot.Instance.PlayerData); GameRoot.Instance.SetPlayerDataByStrong(msg.rspStrong); int curFight = NETCommon.GetFightByProps(GameRoot.Instance.PlayerData); strongWindow.RefreshUI(); mainCityWindow.RefreshUI(); GameRoot.AddTips(Constans.ColorStr("战力提升:" + (curFight - fight), TxtColor.Blue)); if (msg.pshTaskPrgs != null) { PshTaskPrgs(msg); } }
public void RefreshUI() { PlayerData pd = GameRoot.Instance.PlayerData; SetText(txtFight, NETCommon.GetFightByProps(pd)); int powerLimit = NETCommon.GetPowerLimit(pd.lv); SetText(txtPower, "体力:" + pd.power + "/" + powerLimit); imgPowerPrg.fillAmount = pd.power * 1.0f / powerLimit; SetText(txtLevel, pd.lv); SetText(txtName, pd.name); #region ExpPrg int expPrgVal = (int)(pd.exp * 1.0f / NETCommon.GetExpUpValByLv(pd.lv) * 100); SetText(txtExpPrg, expPrgVal + "%"); int index = expPrgVal / 10; float globalRate = 1f * Constans.ScreenStandardHeight / Screen.height; float screenWidth = globalRate * Screen.width; float itemWidht = (screenWidth - 181f) / 10f; expGridGroup.cellSize = new Vector2(itemWidht, 7f); for (int i = 0; i < expItems.Length; i++) { Image item = expItems[i]; if (i < index) { item.fillAmount = 1f; } else if (i == index) { item.fillAmount = (float)(expPrgVal % 10) / 10; } else { item.fillAmount = 0f; } } #endregion // 设置自动任务图标 curTaskData = resSev.GetAutoGuidCfg(pd.guidid); if (curTaskData != null) { SetGuideBtnIcon(curTaskData.npcID); } }
private void RefreshUI() { PlayerData pd = GameRoot.Instance.PlayerData; SetText(txtInfo, pd.name.ConnectStr(" LV.").ConnectStr(pd.lv).EndConnectStr()); int lvVal = NETCommon.GetExpUpValByLv(pd.lv); SetText(txtExp, pd.exp.ConnectStr('/').ConnectStr(lvVal).EndConnectStr()); imgExpPrg.fillAmount = pd.exp * 1f / lvVal; int powerVal = NETCommon.GetPowerLimit(pd.lv); SetText(txtPower, pd.power.ConnectStr('/').ConnectStr(powerVal).EndConnectStr()); imgPowerPrg.fillAmount = pd.power * 1f / powerVal; SetText(txtJob, "职业 暗夜刺客"); SetText(txtFight, "战力 ".ConnectStr(NETCommon.GetFightByProps(pd)).EndConnectStr()); SetText(txtHp, "血量 ".ConnectStr(pd.hp).EndConnectStr()); SetText(txtHurt, "伤害 ".ConnectStr(pd.ad + pd.ap).EndConnectStr()); SetText(txtDef, "防御 ".ConnectStr(pd.addef + pd.apdef).EndConnectStr()); // 刷新细节 RefreshDetailPanel(); }