void Update() { timerValue = toggleTimer.GetValue(); if (!Application.isPlaying) { HandleSetActive(); return; } float timeRemaining = timerValue; if (toggleTimer.changeAmountMultiplier > 0) { timeRemaining = toggleTimer.value.max - timerValue; } if (timeRemaining > 1) { timerText.text = "" + MathfExtensions.RoundToInterval(timeRemaining, 1f); } else { timerText.text = "" + MathfExtensions.RoundToInterval(timeRemaining, .1f); } HandleSetActive(); }
void Update() { spriteRenderer.color = ColorExtensions.SetAlpha(spriteRenderer.color, (breakTimer.value.max - breakTimer.GetValue()) / breakTimer.value.max); if (breakTimer.value.GetValue() == breakTimer.value.max) { Destroy(gameObject); } }