public virtual void OnDoubleClick(HPacket packet) { if (DisableEventHandlers == false) { try { OnDoubleClickEvent.Invoke(this, packet); } catch { }; //Invoke event handler } }
private void CheckDoubleClick() { if (Input.GetMouseButtonDown(0)) { _time2 = Time.realtimeSinceStartup; if (_time2 - _time1 < 0.2f) { OnDoubleClickEvent?.Invoke(); } _time1 = _time2; } }