public void UpdateValue(int newValue, TextUpdateType updateType) { if (this.goalValue == newValue) { return; } this.goalValue = newValue; if (updateType == TextUpdateType.Instant) { if (this.intValue != newValue) { this.intValue = newValue; this.goalValue = newValue; this.UpdateText(); } } else if (updateType == TextUpdateType.Animate) { this.AnimateToGoal(); } else if (updateType == TextUpdateType.None) { // do nothing } else { Debug.LogErrorFormat("IntText.UpdateValue found unknown TextUpdateType {0}", updateType.ToString()); } }
private void StatusUpdate(bool print, string text, TextUpdateType type) { if (print) { StatusUpdate(text, type); } }
private void StatusUpdate(string text, TextUpdateType type) { Color color = Color.Black; FontStyle fontStyle = FontStyle.Regular; bool append = true; switch (type) { case TextUpdateType.Normal: break; case TextUpdateType.Success: color = Color.Green; fontStyle = FontStyle.Bold; break; case TextUpdateType.Info: color = Color.Brown; fontStyle = FontStyle.Bold; break; case TextUpdateType.Warning: color = Color.Orange; fontStyle = FontStyle.Bold; break; case TextUpdateType.Error: color = Color.Red; fontStyle = FontStyle.Bold; break; case TextUpdateType.Begin: fontStyle = FontStyle.Bold; append = false; // Append History Override if (CHECKBOX_AppendHistory.Checked) { append = true; text = Environment.NewLine + text; } break; default: break; } StatusUpdate(text, color, fontStyle, append); }