public ButtonHoldWidget(ButtonEx uiButton, Action completeAction, float cdTime) : base(uiButton, completeAction) { this.recoverTime = float.MaxValue; this.cdTime = cdTime; this.needUpdate = false; RegistEvent("OnPointDown", OnPointDown); RegistEvent("OnPointUp", OnPointUp); }
private static bool CreateButtonExIfNotExist(Button button, out ButtonEx buttonEx) { if (button == null) { Debug.LogWarning("call 'CreateButtonEx' function with null Button param !"); buttonEx = null; return(false); } return(CreateButtonExIfNotExist(button.gameObject, out buttonEx)); }
private static bool CreateButtonExIfNotExist(GameObject go, out ButtonEx buttonEx) { if (go == null) { Debug.LogWarning("call 'CreateButtonEx' function with null GameObject param !"); buttonEx = null; return(false); } else { buttonEx = go.GetComponent <ButtonEx>(); if (buttonEx == null) { buttonEx = go.AddComponent <ButtonEx>(); } return(true); } }
public ButtonClickWidget(ButtonEx buttonEx, Action completeAction, float cdTime) : base(buttonEx, completeAction) { this.recoverTime = float.MinValue; this.cdTime = cdTime; RegistEvent <PointerEventData>("OnClick", this.OnClick); }