Author Topic: [Fixed] NGUI Drag and Drop "OnDrop" Event Inconsistent  (Read 4601 times)

Maskawanian

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 5
    • View Profile
[Fixed] NGUI Drag and Drop "OnDrop" Event Inconsistent
« on: December 25, 2013, 03:22:05 AM »
Hey,

I just got NGUI during that sale and have been attempting to work it into my project.

So far it is working well, however I am having some issues where the OnDrop event gets called sometimes but not other times.

What I am doing uses this tutorial as a base on youtube.

Here is a small video with annotations I have made that illustrates the problem: http://www.youtube.com/watch?v=qOslo5HkGTA

The script that accepts the drop event is located on an invisible widget that contains the scroll view. Here is the code.

The grid that contains these items is directly within the scroll view. This also has a box collider.

The grid items are instantiated at runtime. The items have a box collider as well. Some grid items are disabled when they can't be moved over, done by changing the sprite's color to half transparent. In addition disabling the UIDragDropItem component on the item using code. This is all done by a custom script on the items. Here is the code for that script.

I hope someone more experienced then I can help me track down this heisenbug!

Thanks in advance.
Dan
« Last Edit: December 25, 2013, 04:55:42 AM by Maskawanian »

Maskawanian

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 5
    • View Profile
Re: NGUI Drag and Drop "OnDrop" Event Inconsistent
« Reply #1 on: December 25, 2013, 04:55:30 AM »
Ah,

Looks like a fresh look a bit later solved it. Turns out the items themselves were eating the events, easy enough fix.

Thanks