Welcome,
Guest
. Please
login
or
register
.
June 12, 2025, 07:21:10 AM
Home
Help
Search
Login
Register
Tasharen Entertainment Forum
»
Support
»
NGUI 3 Support
»
3.0.2 DragDropItem can drop erroneously
« previous
next »
Print
Pages: [
1
]
Author
Topic: 3.0.2 DragDropItem can drop erroneously (Read 1883 times)
KyleStaves
Newbie
Thank You
-Given: 0
-Receive: 0
Posts: 13
3.0.2 DragDropItem can drop erroneously
«
on:
October 23, 2013, 11:02:09 AM »
I'm sure there is also an issue on how I have my object set up, but it manifests itself in a way I would consider a bug with NGUI as well.
So basically I have a DropDropItem that has a collider of course. Part of that DragDropItem is a button (nested under the DragDropItem root). Clicking the button can cause Drop() to be called in situations where OnDrag is never called. I fixed it by changing:
mIsDragging
=
false
;
Collider col
=
collider
;
if
(
col
!=
null
)
col
.
enabled
=
!
isPressed
;
if
(
!
isPressed
)
Drop
(
)
;
to
if
(
mIsDragging
)
{
mIsDragging
=
false
;
if
(
!
isPressed
)
Drop
(
)
;
}
Collider col
=
collider
;
if
(
col
!=
null
)
col
.
enabled
=
!
isPressed
;
in OnPress of DragDropItem.cs
EDIT:
I forgot to mention that this is an issue because 'dropping' an object that has never been dragged causes the depth to creep lower in increments of 100.
«
Last Edit: October 23, 2013, 11:24:25 AM by KyleStaves
»
Logged
JMab
Newbie
Thank You
-Given: 0
-Receive: 0
Posts: 8
Re: 3.0.2 DragDropItem can drop erroneously
«
Reply #1 on:
October 23, 2013, 05:16:33 PM »
Yes, I think that is a bug too - I put in my own fix yesterday.
To be fair, it's in the example code, rather than the core NGUI library, so some tweaks to the code are probably expected.
Logged
Print
Pages: [
1
]
« previous
next »
Tasharen Entertainment Forum
»
Support
»
NGUI 3 Support
»
3.0.2 DragDropItem can drop erroneously