diff --git a/Scripts/Controls/CooldownButton.cs b/Scripts/Controls/CooldownButton.cs index d1c0e05..502362b 100644 --- a/Scripts/Controls/CooldownButton.cs +++ b/Scripts/Controls/CooldownButton.cs @@ -139,6 +139,18 @@ namespace UnityEngine.UI.Extensions } } + /// + /// Start a cooldown from outside + /// + public void StartCooldown() + { + PointerEventData emptySource = new PointerEventData(EventSystem.current); + buttonSource = emptySource; + OnCooldownStart.Invoke(emptySource.button); + cooldownTimeRemaining = cooldownTimeout; + CooldownActive = cooldownInEffect = true; + } + /// /// Stop a running Cooldown and reset all values ///