Tasharen Entertainment Forum

Support => NGUI 3 Support => Topic started by: pretender on October 03, 2014, 04:33:58 AM

Title: NGUI with MVC pattern, example inside
Post by: pretender on October 03, 2014, 04:33:58 AM
I recently found about this article http://engineering.socialpoint.es/MVC-pattern-unity3d-ui.html where MVC pattern is used to implement UI (in this case NGUI is used).

It seems like an overkill, but it could be good learning example. Take a look and comment if possible is it a good practice?
Thanks!
Title: Re: NGUI with MVC pattern, example inside
Post by: ArenMook on October 04, 2014, 07:41:16 AM
I would never use a plain C# object in Unity like that. Every class should belong to some game object, meaning a MonoBehaviour. In Windward I often use these "manager" classes on the root object of a game window (the UIPanel generally). They are basically scripts with some simple functionality and references to all the needed components, such as text labels and buttons I expect people to click. This way everything is set in one place.