- Home /
This question was
closed May 01, 2018 at 12:15 PM by
Wokarol for the following reason:
The question is answered, right answer was accepted
Offsetting RectTransform based on button state button
I want to add offset to targeted RectTransform when button is in pressed or disabled state and other way around. Something like this:
Is there any easy way to check current button state through script? I'm trying my best and always there are some cases when everything goes wrong, mostly due to changing button.interactible while button is pressed or by moving cursor while button is pressed.
zrzut-ekranu-80.png
(29.3 kB)
Comment
Best Answer
Answer by tormentoarmagedoom · Apr 03, 2018 at 03:41 PM
Good day.
You can create some bool variables, and using Eventsystem, make them true when mouseEnter, when mouseDown, etc
And only move the transform when the bool variables you want are true.