fix(cooldown-button): add a fake event to avoid null buttonSource

pull/413/head
Gabriel Juchault 2018-11-21 14:47:49 +00:00
parent ff548fec7e
commit c2b8b39fa1
1 changed files with 4 additions and 2 deletions

View File

@ -144,9 +144,11 @@ namespace UnityEngine.UI.Extensions
/// </summary> /// </summary>
public void StartCooldown() public void StartCooldown()
{ {
OnCooldownStart.Invoke(new PointerEventData.InputButton()); PointerEventData emptySource = new PointerEventData(EventSystem.current);
buttonSource = emptySource;
OnCooldownStart.Invoke(emptySource.button);
cooldownTimeRemaining = cooldownTimeout; cooldownTimeRemaining = cooldownTimeout;
cooldownActive = cooldownInEffect = true; CooldownActive = cooldownInEffect = true;
} }
/// <summary> /// <summary>