Closed nah0y closed 9 years ago
Well, there are times when you want to edit the text without the size of the button changing. That said, that's probably not really much of the time, so maybe I could make it automatic but give it a toggle.
You're gonna love what I've done with the SnapButtonToText component!
It's now much more efficient - it works out all the dimensions from one ContentSizeFitter on the Text, instead of making lots of temporary ContentSizeFitters and LayoutGroups.
It also works automatically, but only when the RectTransform size on the text has changed since the last frame. Works beautifully in both play and edit modes :D
Yay :) Congrats!
This is just perfect :) Way much better to use.
Just a suggestion,
Why don't you put something in the Update of the script, so it can check every frame (in editor only) if the text has changed, if it has, you just call the method to snap the button to text. So we don't have to press the button snap and save the scene to make things look good?