public override void UpdateValue(float value, int displayValue, int effect, float maxValue = 100.0f) { if (Value != null) { Value.text = displayValue + EffectSuffixCreator.Create(effect); } float fullWidth = GetComponentInParent <RectTransform>().sizeDelta.x; var temp = GreenBar.sizeDelta; temp.x = fullWidth * (value / maxValue); GreenBar.sizeDelta = temp; }
void Update() { StatsDifference effect = Effect.Effect; Money.text = State.State.GetStateItemValue <int>(StateItemType.Money.ToString()) + EffectSuffixCreator.Create(effect.GetStat(StateItemType.Money.ToString())); MoneyPerWorkshift.text = Mathf.FloorToInt(State.State.GetStateItemValue <int>(StateItemType.MySalary.ToString())) + EffectSuffixCreator.Create(effect.GetStat(StateItemType.MySalary.ToString())); MoneyPerPartnersWorkshift.text = Mathf.FloorToInt(State.State.GetStateItemValue <int>(StateItemType.PartnerSalary.ToString())) + EffectSuffixCreator.Create(effect.GetStat(StateItemType.PartnerSalary.ToString())); FoodSupplies.text = Mathf.FloorToInt(State.State.GetStateItemValue <int>(StateItemType.FoodSupplies.ToString())) + EffectSuffixCreator.Create(effect.GetStat(StateItemType.FoodSupplies.ToString())); Age.text = Mathf.FloorToInt(State.State.GetStateItemValue <float>(StateItemType.Age.ToString())).ToString(); }