diff --git a/FutileProject/Assets/Futile/Extras/FButton.cs b/FutileProject/Assets/Futile/Extras/FButton.cs index d583e60..213ae0b 100644 --- a/FutileProject/Assets/Futile/Extras/FButton.cs +++ b/FutileProject/Assets/Futile/Extras/FButton.cs @@ -206,6 +206,8 @@ virtual public bool HandleSingleTouchBegan(FTouch touch) virtual public void HandleSingleTouchMoved(FTouch touch) { + if (!_isTouchDown) return; //If button is disabled, we still get the HandleSingleTouchMoved event but _isTouchDown is false, and we don't want to change the button state in that case + Vector2 touchPos = _sprite.GetLocalTouchPosition(touch); //expand the hitrect so that it has more error room around the edges @@ -234,6 +236,8 @@ virtual public void HandleSingleTouchMoved(FTouch touch) virtual public void HandleSingleTouchEnded(FTouch touch) { + if (!_isTouchDown) return; //If button is disabled, or if mouse/touch went out of the expandedRect, we don't want to send the click Signal + _isTouchDown = false; _sprite.element = _upElement;