Simon Jackson 2022-04-23 11:49:46 +01:00
parent 771c7776c0
commit 3582824afa
1 changed files with 4 additions and 1 deletions

View File

@ -381,16 +381,19 @@ namespace UnityEngine.UI.Extensions
ToList = _currentReorderableListRaycasted, ToList = _currentReorderableListRaycasted,
ToIndex = _fakeElement.GetSiblingIndex() ToIndex = _fakeElement.GetSiblingIndex()
}; };
//Send OnelementDropped Event //Send OnelementDropped Event
if (_reorderableList && _reorderableList.OnElementDropped != null) if (_reorderableList && _reorderableList.OnElementDropped != null)
{ {
_reorderableList.OnElementDropped.Invoke(args); _reorderableList.OnElementDropped.Invoke(args);
} }
if (!isValid)
if (!isValid || (!IsTransferable && _currentReorderableListRaycasted != _reorderableList))
{ {
CancelDrag(); CancelDrag();
return; return;
} }
RefreshSizes(); RefreshSizes();
_draggingObject.SetParent(_currentReorderableListRaycasted.Content, false); _draggingObject.SetParent(_currentReorderableListRaycasted.Content, false);
_draggingObject.rotation = _currentReorderableListRaycasted.transform.rotation; _draggingObject.rotation = _currentReorderableListRaycasted.transform.rotation;