/// <summary> /// Response mouse left button up. /// </summary> protected virtual void OnMouseUp() { if (!isEnabled) { return; } if (selfLock) { isLock = !isLock; } if (isLock) { currentOffset = downOffset * lockPercent; OnLock.Invoke(); } else { IsDown = false; currentOffset = 0; OnUp.Invoke(); } Translate(currentOffset); if (useLED && !isLock) { LED.TurnOff(); } }
/// <summary> /// Response mouse left button down. /// </summary> protected virtual void OnMouseDown() { if (!isEnabled) { return; } IsDown = true; currentOffset = downOffset; Translate(currentOffset); if (useLED) { LED.TurnOn(); } OnDown.Invoke(); }