Tasharen Entertainment Forum

Support => NGUI 3 Support => Topic started by: xiaoniaojjj on September 25, 2012, 01:16:34 AM

Title: How to response the OnHover in item container when dragging item!
Post by: xiaoniaojjj on September 25, 2012, 01:16:34 AM
I creat a class like UIItemSlot, How to response OnHover  in  item container when dragging item, i try to user OnHover in My class,but i doesn't work when dragging.
i can use OnMouseOver to resolved.But have any easy way to get it?
Title: Re: How to response the OnHover in item container when dragging item!
Post by: ArenMook on September 25, 2012, 08:15:44 AM
When you start the drag process, disable the dragged object's collider and set UICamera.selectedObject = null in addition to UICamera.currentTouch.pressed = null. This clear the reference to what's being dragged, and you will be receiving OnHover events on your items.
Title: Re: How to response the OnHover in item container when dragging item!
Post by: xiaoniaojjj on January 09, 2013, 12:16:39 PM
It's my code in below: But the item still can't receive the OnHover when Mouse Pressed dragging, They would be fine when the Mouse Released ,
UICamera.selectedObject = null;
UICamera.currentTouch.pressed = null;
BoxCollider bc = GetComponent<BoxCollider>();
bc.enabled = false;
bc.isTrigger = false;
Title: Re: How to response the OnHover in item container when dragging item!
Post by: ArenMook on January 09, 2013, 03:25:26 PM
I think you might have to dig deeper into the sequence of events to figure out what's happening in your case.