private void InvokeOnClickDelegate() { if (onClick != null && onClick.GetInvocationList().Length != 0) { onClick.Invoke(); } }
public void ProcessClick(Vector3 clickPos) { if (OnClickEvent != null) { OnClickEvent(clickPos); } print(string.Format("GC: OnClickEvent triggered {0} event call(s)", OnClickEvent.GetInvocationList().Length)); }
public void ClearClickEvent() { if (OnClickEvent != null) { Delegate[] invokeList = OnClickEvent.GetInvocationList(); if (invokeList != null) { foreach (Delegate del in invokeList) { OnClickEvent -= (OnClickDlg)del; } } } }
internal override void OnUpdate() { Vector2f mousePosition = Input.TackInput.MousePosition(); if (mousePosition.X >= Bounds.X && mousePosition.X <= (Bounds.X + Bounds.Width)) { if (mousePosition.Y >= Bounds.Y && mousePosition.Y <= (Bounds.Y + Bounds.Height)) { m_hovering = true; if (TackInput.MouseButtonDown(MouseButtonKey.Left)) { m_pressing = true; if (OnClickEvent != null) { if (OnClickEvent.GetInvocationList().Length > 0) { OnClickEvent.Invoke(this, EventArgs.Empty); } } } } else { m_hovering = false; } } else { m_hovering = false; } if (TackInput.MouseButtonUp(MouseButtonKey.Left)) { m_pressing = false; } }