void InitPlayerInfo() { PlayerState state = userPackage.GetPlayerState(); bloodProgess.value = (float)state.blood / (float)(20 + 2 * state.health); bloodLabel.text = string.Format("{0}/{1}", state.blood, 20 + 2 * state.health); hungerProgress.value = (float)state.hunger / (float)(20 + 2 * state.health); hungerLabel.text = string.Format("{0}/{1}", state.hunger, 20 + 2 * state.health); thirstProgress.value = (float)state.thirst / (float)(20 + 2 * state.health); thirstLabel.text = string.Format("{0}/{1}", state.thirst, 20 + 2 * state.health); interestLabel.text = string.Format("分配比例:{0:f}%", (float)userPackage.GetPlayerInterest() * 100); resLabel.text = GlobalFunction.NumberFormat(itemPackage.GetResourceTotolNumber()); moneyLabel.text = GlobalFunction.NumberFormat(itemPackage.GetGoldNumber()); elecLabel.text = string.Format("{0}/h", GlobalFunction.NumberFormat(sanctuaryPackage.GetTotalProEfficiency())); attackLabel.text = state.attack.ToString(); defenseLable.text = state.defense.ToString(); agileLabel.text = state.agile.ToString(); speedLabel.text = state.speed.ToString(); intellectLabel.text = state.intellect.ToString(); healthLabel.text = state.health.ToString(); moodLabel.text = state.mood.ToString(); loadLabel.text = "0"; float progress; userPackage.GetPlayerLevel(out progress); expProgress.value = progress; levelLabel.text = string.Format("Lv.{0}", userPackage.GetPlayerLevel()); expLabel.text = string.Format("个人实力:{0}", userPackage.GetPersonContribution()); nameLabel.text = userPackage.GetUserInfo(userPackage.UserID).name; }
public int GetTotalProEfficiency() { UserPackage userPackage = FacadeSingleton.Instance.RetrieveData(ConstVal.Package_User) as UserPackage; double sum = 0; foreach (var pair in mBuildingInfoMap) { if (GetBuildingFuncByConfigID(pair.Value.configID) != BuildingFunc.Collect) { continue; } BUILDING buildingConfig = GetBuildingConfigDataByConfigID(pair.Value.configID); string name = buildingConfig.BldgFuncTableName; name = name.ToUpper(); int level = GetBulidingLevelByConfigID(pair.Value.configID); var configMap = ConfigDataStatic.GetConfigDataTable(name); var funcConfig = configMap[level]; Type type = Type.GetType("com.nkm.framework.resource.data." + name); string propertyName = name[0] + name.Substring(1).ToLower(); PropertyInfo spdInfo = type.GetProperty(propertyName + "Spd"); int spd = (int)spdInfo.GetValue(funcConfig, null); sum += spd; } //add number buff int personNum = userPackage.GetManorPersonNumber(); if (personNum == 2) { sum *= 1.6f; } if (personNum == 3) { sum *= 2.2f; } if (personNum == 4) { sum *= 2.8f; } return((int)((double)sum * userPackage.GetPlayerInterest())); }