Tasharen Entertainment Forum

Support => NGUI 3 Support => Topic started by: Medico on January 03, 2016, 05:53:05 PM

Title: Sprite run code after entering container?
Post by: Medico on January 03, 2016, 05:53:05 PM
Is there way I can have a sprite know that it's been dragged successfully into a new container and, based on the container, run a function.
 
Title: Re: Sprite run code after entering container?
Post by: Medico on January 04, 2016, 12:35:25 PM
I'll add that I think what I'm looking for is a possible function that is called on a UI sprite when it enters a new container or grid.
Title: Re: Sprite run code after entering container?
Post by: ArenMook on January 05, 2016, 07:02:05 AM
You can do whatever you want in the UIDragDropItem.OnDragEnd, or on the container's OnDragDropRelease. They are both virtual functions, so derive a class from UIDragDropItem and do what you want.

Alternatively use OnDragOver() -- a native NGUI notification.