private ITextComponent SetValue_INTERNAL(long value, TextValueFormat format, bool animate, bool fromTweener) { if (fromTweener == true && this.tempLastValue == value && this.tempLastFormat == format) { return(this); } this.tempLastValue = value; this.tempLastFormat = format; var tag = this.GetCustomTag("TextComponent"); if (fromTweener == false && TweenerGlobal.instance != null) { TweenerGlobal.instance.removeTweens(tag); } if (animate == true && TweenerGlobal.instance != null) { this.tempLastValue = value - 1L; var duration = this.valueAnimateDuration; if (Mathf.Abs(this.valueAnimateLastValue - value) < 2) { duration = 0.2f; } TweenerGlobal.instance.addTweenCount(this, duration, this.valueAnimateLastValue, value, format, (v) => { this.valueAnimateLastValue = v; this.SetValue_INTERNAL(v, format, animate: false, fromTweener: true); }).tag(tag); } else { this.SetText_INTERNAL(TextComponent.FormatValue(value, format)); } return(this); }
public static string FormatValue(long value, TextValueFormat format) { return(TextComponent.FormatValue((double)value, format)); }
public void SetValue(int value, ValueFormat format = ValueFormat.None) { this.SetText(TextComponent.FormatValue(value, format)); }