I ma trying to create an "SELECT" like wheel in my game with NGUI. I am doing so by creating a panel with a "center to child" attached to my scrollview. So far so good :-)
Now, I can't figure out how to determine which listitem (gameobject) is actual active?
Hoping for help in this matter and by the way. Merry Christmas :-)
You are probably looking for
gameObject.activeSelf
, (a comment mentionedobj.active
which is deprecated).So iterate through your listitems something like:
item
in this context is the actual NGUI component that you are referencing, in Unity everything has a recursive lookup to it's parent game object, and it's parent's parent game object and so on. You can literally have a label on a nested game object and get down to the root by doing something silly likelabel.gameObject.gameObject.gameObject
etc...If you are just referencing the game object itself or a list of game objects, then just omit the
item
in my code.