public void OnMouseUp(IMouseEventListener clickable) { if (m_clickable == null || m_clickable != clickable) { return; } if (m_clickTimer < 0) { m_clickable = null; return; } if (m_lastClickable != null && m_lastClickable == m_clickable) { m_clickable.OnDoubleClick(m_currentMouseButton); m_lastClickable = null; m_doubleClickTimer = 0f; } m_lastClickable = m_clickable; m_doubleClickTimer = 0.2f; m_clickable.OnClick(m_currentMouseButton); m_clickable = null; }
private void Update() { m_clickTimer -= Time.deltaTime; m_doubleClickTimer -= Time.deltaTime; if (m_doubleClickTimer <= 0) { m_lastClickable = null; } }
private void AddListenerImpl(IMouseEventListener listener, bool updateHookService = true) { if (_inEventHandler) { _removeQueue.Remove(listener); _addQueue.Add(listener); } else { Listeners.Add(listener); } if (updateHookService) { UpdateHookService(); } }
public void OnMouseDown(IMouseEventListener clickable) { m_clickable = clickable; m_clickTimer = 0.2f; }
public static void AddListener(IMouseEventListener listener) { Instance.AddListenerImpl(listener); }
public static void RemoveListener(IMouseEventListener listener) { Instance.RemoveListenerImpl(listener); }