I'm so glad there is a clone option, that is exactly what I wanted! However it looks like the cloned GameObject is being destroyed after releasing the DragDropItem!
protected virtual void OnDragDropRelease (GameObject surface)
{
if (!cloneOnDrag)
{
...
}
else NGUITools.Destroy(gameObject);
}
Why?! In my game I have an inventory, just imagine you have a stack of potions represented by 1 DragDropItem widget, and I want to drag just one of these potions onto my belt, for example.
Things I don't know and need help with:
1. The duplicated potion widget is getting destroyed and not sticking to my belt DragDropContainer slot. I would like this duplicate to be re-parented just like the origin would be if I'm not using duplicates.
2. How do I get notified that the DragDropItem has been released? Does my belt slot need to have a function defined and it will get called whenever an item is dropped on it? I don't see the DragDropContainer having any mechanism allowing me to add a delegate to be called.
3. Does it look like I will have to extend the UIDragDropItem class to implement re-parenting of the clone? And extending UIDragDropContainer so that I can get notified when an item is dropped? I have very specific slots and need to know when items are dropped on them and when items are removed from them.
Attached a screenshot so it will give you an idea what I'm trying to do.