public IEnumerator IETextAnimation(TextMeshProUGUI text, float value, int num) { float targetTime = 1; float interpolation = 0; float currvalue = 0; while (interpolation < targetTime) { interpolation += Time.deltaTime; currvalue = Mathf.Lerp(currvalue, value, interpolation); if (num == 1) { text.text = StringType.Time(currvalue); } else if (num == 2) { text.text = StringType.KillCount(currvalue); } yield return(null); } interpolation = 0; }