protected virtual void Execute(UIEventData eventData, Rect rect) { if (!m_Filter[this]) { return; } try { GetSlotValues(m_Event, m_ValuesTmp); if (eventData.WaitHandle != null) { foreach (var action in m_ValuesTmp) { eventData.WaitHandle.AddWait(); ThreadPool.QueueUserWorkItem(c => action.Invoke((UIEventData)c), eventData); } } else { foreach (var action in m_ValuesTmp) { action.Invoke(eventData); } } } finally { m_ValuesTmp.Clear(); } }
private void Execute(UIEventData eventData) { try { Execute(eventData, eventData.Rect); } finally { if (eventData.WaitHandle != null) { eventData.WaitHandle.MarkDone(); } } }
private void CalculateRect(UIEventData eventData) { if (eventData.EventType == UIEventType.Layout) { var parentRect = eventData.Rect; var outRect = new Rect { x = m_AnchorMin.x * parentRect.width + m_OffsetMin.x, y = m_AnchorMin.y * parentRect.height + m_OffsetMin.y, width = m_AnchorMax.x * parentRect.width - m_OffsetMax.x - m_AnchorMin.x * parentRect.width - m_OffsetMin.x, height = m_AnchorMax.y * parentRect.height - m_OffsetMax.y - m_AnchorMin.y * parentRect.height - m_OffsetMin.y }; m_OutRect.SetValue(outRect); } }