Merged in gjuchault/unity-ui-extensions/gjuchault/featcooldownbutton-add-a-startcooldown-t-1542805885685 (pull request #37)
feat(cooldown-button): add a `StartCooldown` to start cooldown from outsidepull/413/head
commit
ec836f9e87
|
@ -139,6 +139,18 @@ namespace UnityEngine.UI.Extensions
|
|||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Start a cooldown from outside
|
||||
/// </summary>
|
||||
public void StartCooldown()
|
||||
{
|
||||
PointerEventData emptySource = new PointerEventData(EventSystem.current);
|
||||
buttonSource = emptySource;
|
||||
OnCooldownStart.Invoke(emptySource.button);
|
||||
cooldownTimeRemaining = cooldownTimeout;
|
||||
CooldownActive = cooldownInEffect = true;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Stop a running Cooldown and reset all values
|
||||
/// </summary>
|
||||
|
|
Loading…
Reference in New Issue