How to turn off Tooltips prior to removing a widget from its parent

Well looks like I am proven wrong, (Is casting expensive? - #28 by jwatte) I also just accepted the statement that casting was expensive and have generally avoided it. That being said I have always been in the habit of setting references outside of loops to avoid allocations and things so I still don’t think it’s a terrible idea. I also like the use of interfaces as it decouples the code nicely.

As for creating the widget once, yeah I like the idea as long as it is gonna be used often in the current game state - I assume as this is inventory it will be.

If the inventory widget has lots of references to objects that need to be queried and used you will have a instantiation cost for that widget that would be nice to only do once.

The only good reason to get rid of it is like you say to hopefully free up memory if needed but pointless is you will keep having to re-instantiate it and re-use the memory anyway.