Tasharen Entertainment Forum

Support => NGUI 3 Support => Topic started by: 4everlove on October 15, 2012, 04:22:09 AM

Title: Best practices for in-game GUI
Post by: 4everlove on October 15, 2012, 04:22:09 AM
Due to the limitation of default button components, I create several customized button classes (e.g., BuildButton) and make corresponding prefabs because all these customized buttons share some parameters. However, I have many different levels in my game, so I create a GUI prefab, then in other maps I can simply drag GUI prefab to the scene then everything is done. Here comes the problem. If I add the game objects created by custom button prefabs, then apply the change to GUI prefab. I will lose the connection between customized button game objects and original prefabs. There are tens of these buttons so it's annoying to modify them one by one if I have to change some parameters in the BuildButton prefab. Is there any solution for my situation? thanks!
Title: Re: Best practices for in-game GUI
Post by: ArenMook on October 15, 2012, 06:19:27 AM
Unity 4 has a nested prefab feature that may be helpful for you here. Other than that, I can't suggest much.
Title: Re: Best practices for in-game GUI
Post by: 4everlove on October 15, 2012, 08:52:38 PM
Unity 4 has a nested prefab feature that may be helpful for you here. Other than that, I can't suggest much.

Thanks Aren, how did you usually organize GUI with customized and replicable objects shared by multiple maps?
Title: Re: Best practices for in-game GUI
Post by: ArenMook on October 16, 2012, 08:38:57 AM
I have not yet migrated to Unity 4, so I can't take advantage of the nested prefabs. In Windward I just have one "common prefab" that contains everything shared between scenes -- from item databases to the UI layout. Since all maps are different, I may change the values of some scripts on that prefab, but it mostly remains untouched.