圣者
精华
|
战斗力 鹅
|
回帖 0
注册时间 2016-6-13
|
private void UpdatePoints()
{
this._selectedPoints = new int[4];
foreach (ProtagonistFeatureItem protagonistFeatureItem in this._selectedAbilities)
{
this._selectedPoints[(int)protagonistFeatureItem.Type] += (int)protagonistFeatureItem.Cost;
}
Refers refers = base.CGet<Refers>("AbilityView");
refers.CGet<TextMeshProUGUI>("FamilyPText").text = "(" + this._selectedPoints[0].ToString() + ")";
refers.CGet<TextMeshProUGUI>("WealthPText").text = "(" + this._selectedPoints[1].ToString() + ")";
refers.CGet<TextMeshProUGUI>("SkillPText").text = "(" + this._selectedPoints[2].ToString() + ")";
refers.CGet<TextMeshProUGUI>("FamilyPToggleText").text = this._selectedPoints[0].ToString();
refers.CGet<TextMeshProUGUI>("WealthPToggleText").text = this._selectedPoints[1].ToString();
refers.CGet<TextMeshProUGUI>("SkillPToggleText").text = this._selectedPoints[2].ToString();
refers.CGet<CImage>("FamilyBar").fillAmount = (float)this._selectedPoints[0] / 10f;
refers.CGet<CImage>("WealthBar").fillAmount = (float)this._selectedPoints[1] / 10f;
refers.CGet<CImage>("SkillBar").fillAmount = (float)this._selectedPoints[2] / 10f;
this._selectedPoints[3] = this._selectedPoints[0] + this._selectedPoints[1] + this._selectedPoints[2];
refers.CGet<TextMeshProUGUI>("AbilityPText").text = "(" + LocalStringManager.Get(158) + Mathf.Max(0, 10 - this._selectedPoints[3]).ToString() + ")";
refers.CGet<CButton>("ClearAbility").interactable = (this._selectedPoints[3] > 0);
RectTransform rectTransform = refers.CGet<RectTransform>("LeftPoints");
for (int i = 0; i < rectTransform.childCount; i++)
{
CImage componentInChildren = rectTransform.GetChild(i).GetComponentInChildren<CImage>();
bool flag = i < this._selectedPoints[3];
if (flag)
{
componentInChildren.SetSprite("newgame_zizhi_dianshu_1", false, null);
}
else
{
componentInChildren.SetSprite("newgame_zizhi_dianshu_0", false, null);
}
}
}
因为计算的是合计值不是剩余值,可以试试锁这个,不行就等个mod吧 |
|