Skip to content

Commit ccf1db8

Browse files
committed
Dispatch drag start event in StartDrag
1 parent c9bfe24 commit ccf1db8

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

Assets/Scripts/UI/GObject.cs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2016,6 +2016,9 @@ private void InitDrag()
20162016

20172017
private void DragBegin(int touchId)
20182018
{
2019+
if (DispatchEvent("onDragStart", touchId))
2020+
return;
2021+
20192022
if (draggingObject != null)
20202023
{
20212024
GObject tmp = draggingObject;
@@ -2074,8 +2077,7 @@ private void __touchMove(EventContext context)
20742077
return;
20752078

20762079
_dragTesting = false;
2077-
if (!DispatchEvent("onDragStart", evt.touchId))
2078-
DragBegin(evt.touchId);
2080+
DragBegin(evt.touchId);
20792081
}
20802082

20812083
if (draggingObject == this)

0 commit comments

Comments
 (0)