2D Toolkit Forum
2D Toolkit => Support => Topic started by: gerlonx on March 10, 2012, 01:05:45 pm
-
I had parenting some buttons in another gameobject, I tried to SetActiveRecursively(false) the parent and back to (true), and all buttons could not work. Is there another solution to make active/inactive all at once effectively?
-
If the button is currently animating when it gets disabled it breaks. Adding this fixed it for me:
void OnEnable(){
buttonDown = false;
}
You probably want to run some cleanup too, to ensure your buttons appear correctly after the disabling if you do any sort of scaling. I ended up just writing my own button script (I'll share it eventually, not in a great state atm though - and it depends on the "FingerGestures" plugin anyway).
-
If the button is currently animating when it gets disabled it breaks. Adding this fixed it for me:
void OnEnable(){
buttonDown = false;
}
You probably want to run some cleanup too, to ensure your buttons appear correctly after the disabling if you do any sort of scaling. I ended up just writing my own button script (I'll share it eventually, not in a great state atm though - and it depends on the "FingerGestures" plugin anyway).
Hey it works, thanks.
Well it seems I was too lazy to check the source code :P
While I was waiting for this answer, I was in the middle of finding another solution with moving its parent position, but that was double-work for me.
Oh, and I'm still curios about your script. ;)
-
Hi KyleStaves, thanks for posting your fix. I will integrate that and merge in the multitouch version as soon as I can. Never really noticed this issue, thanks for bringing it up.