static int OnClick(IntPtr L) { try { ToLua.CheckArgsCount(L, 2); EventTriggerListener obj = (EventTriggerListener)ToLua.CheckObject <EventTriggerListener>(L, 1); UnityEngine.EventSystems.PointerEventData arg0 = (UnityEngine.EventSystems.PointerEventData)ToLua.CheckObject <UnityEngine.EventSystems.PointerEventData>(L, 2); obj.OnClick(arg0); return(0); } catch (Exception e) { return(LuaDLL.toluaL_exception(L, e)); } }
private void OnEventClick(Vector2 worldPos) { if (!m_needClickItem) { OnDestory(); return; } Vector2 clickPos = m_target.parent.InverseTransformPoint(worldPos); if (clickPos.x >= m_target.localPosition.x - m_target.rect.width / 2f && clickPos.x <= m_target.localPosition.x + m_target.rect.width / 2f) { if (clickPos.y >= m_target.localPosition.y - m_target.rect.height / 2f && clickPos.y <= m_target.localPosition.y + m_target.rect.height / 2f) { m_targetEvent.OnClick(); OnDestory(); } } }