protected virtual void Update() { var finalCounters = counters.Count > 0 ? counters : null; var ratio = P3dChangeCounter.GetRatio(finalCounters); if (inverse == true) { ratio = 1.0f - ratio; } cachedImage.fillAmount = Mathf.Clamp01(ratio); }
protected virtual void Update() { var finalCounters = counters.Count > 0 ? counters : null; var total = P3dChangeCounter.GetTotal(finalCounters); var count = P3dChangeCounter.GetCount(finalCounters); if (inverse == true) { count = total - count; } var final = format; var percent = P3dHelper.RatioToPercentage(P3dHelper.Divide(count, total), decimalPlaces); final = final.Replace("{TOTAL}", total.ToString()); final = final.Replace("{COUNT}", count.ToString()); final = final.Replace("{PERCENT}", percent.ToString()); cachedText.text = final; }