feat(cooldown-button): add a `StartCooldown` to start cooldown from outside

pull/413/head
Gabriel Juchault 2018-11-21 13:11:30 +00:00
parent 37aec29aa0
commit 67c2da49b1
1 changed files with 10 additions and 0 deletions

View File

@ -139,6 +139,16 @@ namespace UnityEngine.UI.Extensions
} }
} }
/// <summary>
/// Start a cooldown from outside
/// </summary>
public void StartCooldown()
{
if(OnCooldownStart != null) OnCooldownStart.Invoke(eventData.button);
cooldownTimeRemaining = cooldownTimeout;
cooldownActive = cooldownInEffect = true;
}
/// <summary> /// <summary>
/// Stop a running Cooldown and reset all values /// Stop a running Cooldown and reset all values
/// </summary> /// </summary>