IEnumerator Clock() { while (currentValue > 0f) { currentValue -= GameTime.deltaTime; yield return(null); } HideMessage(); ClockEnded?.Invoke(); yield break; }
protected virtual void CountDown() { time -= Time.deltaTime; if (time <= 0f) { finished = true; //onFinish = true; if (canInvoke) { ClockEnded?.Invoke(); } else { canInvoke = true; } } }
IEnumerator Clock() { while (currentValue > 0f) { currentValue -= GameTime.deltaTime; if (currentValue < 0f) { break; } else { text.text = $"{Math.Floor(currentValue)}"; } yield return(null); } text.text = "0"; ClockEnded?.Invoke(); yield break; }