public override void Tick() { ticks++; if (isNight) { if (ticks >= (DayDurationInTicks / 2)) { ticks = 0; isNight = false; Background.GetComponent <Animation>().Play("night-day", PlayMode.StopAll); dayEffect.gameObject.SetActive(true); nightEffect.gameObject.SetActive(false); enabledEffect = dayEffect; } } else { if (ticks >= (DayDurationInTicks / 2)) { ticks = 0; isNight = true; Background.GetComponent <Animation>().Play("day-night", PlayMode.StopAll); dayEffect.gameObject.SetActive(false); nightEffect.gameObject.SetActive(true); enabledEffect = nightEffect; } } enabledEffect.Trigger(); }
public override void Tick() { Ticks++; ProgressBar.fillAmount = (Ticks / Cooldown); if (ProgressBar.fillAmount == 1) { Button.interactable = true; } else { Button.interactable = false; } PassiveEffect.Trigger(); }