public void OnLongPress() { if (longPressBean != null) { onLongPress(longPressBean.eventData, gameObject, true, longPressBean.args); } longPressBean = null; }
public void OnPointerUp(PointerEventData eventData) { //if (eventData == null) return; if (onPress != null) { if (!IsForbid()) { onPress(eventData, gameObject, false, getEventArgs()); } else if (IsAllowedMe(gameObject)) { onPress(eventData, gameObject, false, getEventArgs()); } } if (onLongPress != null) { if (!IsForbid()) { if (IsInvoking("OnLongPress")) { CancelInvoke("OnLongPress"); longPressBean = null; } } else if (IsAllowedMe(gameObject)) { if (IsInvoking("OnLongPress")) { CancelInvoke("OnLongPress"); longPressBean = null; } } } }
public void OnPointerDown(PointerEventData eventData) { //if (eventData == null) return; //VSUIBtnAnim.DoBTNHoverAnimation(gameObject, true); if (onPress != null) { if (!IsForbid()) { onPress(eventData, gameObject, true, getEventArgs()); } else if (IsAllowedMe(gameObject)) { onPress(eventData, gameObject, true, getEventArgs()); } } if (onLongPress != null) { if (!IsForbid()) { if (!IsInvoking("OnLongPress")) { Invoke("OnLongPress", 2f); longPressBean = new LongPressBean(eventData, getEventArgs()); } } else if (IsAllowedMe(gameObject)) { if (!IsInvoking("OnLongPress")) { Invoke("OnLongPress", 2f); longPressBean = new LongPressBean(eventData, getEventArgs()); } } } }