1
NGUI 3 Support / Re: OnClick and private methods
« on: January 09, 2014, 06:09:41 AM »
I do like your approach ShinyMark. I actually think it makes more sense because your approach is more in line with the Observer pattern. There would still be inspector work to be done as the easiest way to find "_targetButton" would be to create an inspector field that you can drag and drop. The one pro I can see from my system is that anyone can find the button and look at its OnClick handlers in the inspector and instantly know what it's calling, whereas your method would require someone to find the class that receives the has the listener, which may not always be clear (it should be if you set up a consistent scene hierarchy). Your technique though has the advantage of not needing to modify NGUI, so it's not a pain in the butt to upgrade NGUI each time. I say it's a pain in the butt, but it's pretty easy with git, however, it would be nice if it were streamlined anyway.
