Hi guys,
I’m having trouble figuring out how to find out programatically on which item does my NGUI grid center. I have a menu where items can be dragged horizontally and they get centered using UICenterOnChild. What I want is to find out from the script which item the menu is currently centered on.
I looked at the documentation of UICenterOnChild and there is a “delegate void UICenterOnChild.OnCenterCallback(GameObject centeredObject)”. There’s also a function “UICenterOnChild.onCenter” which triggers when a new object is being centered.
Probably the reason I don’t quite understand the documentation is because I don’t know how to use delegates yet. I thought I knew what they were and after looking at the unity’s tutorial on delegates didn’t find anything new but apparently I don’t understand them enough to figure out how to achieve what I want in this case.
If anyone has any idea how to get that info I’ll be happy to hear it.
Thanks in advance for you time.