Tasharen Entertainment Forum

Support => NGUI 3 Support => Topic started by: justkevin on May 07, 2014, 12:30:51 PM

Title: Best practices for showing details on the current selection?
Post by: justkevin on May 07, 2014, 12:30:51 PM
This is a common feature in games: the UI shows details on the current selected object, with the behavior varying on the object type. I've come up with a way of doing this, and I'm interested in hearing suggestions on easier or more flexible solutions:


Does this seem like a reasonable approach?

Title: Re: Best practices for showing details on the current selection?
Post by: justkevin on May 07, 2014, 05:51:38 PM
After further investigation, it appears that NGUI doesn't like it if you modify the transform hierarchy manually, instead the preferred method is to use AddChild().

So my new plan is to change IScannable's signature to have an AttachToNGUI(GameObject parent) method.

I'm still interested in how others have handled this functionality.
Title: Re: Best practices for showing details on the current selection?
Post by: ArenMook on May 08, 2014, 02:32:53 AM
You can modify the transform hierarchy, but you need to let the widgets know that you've done so (NGUITools.MarkParentAsChanged).