Merge branch '3.8' into 3.9-beta

This commit is contained in:
Harald Csaszar 2020-02-12 16:03:18 +01:00
commit d386bcc466

View File

@ -302,6 +302,7 @@ namespace Spine.Unity.Editor {
var eventType = current.type; var eventType = current.type;
bool isDraggingEvent = eventType == EventType.DragUpdated; bool isDraggingEvent = eventType == EventType.DragUpdated;
bool isDropEvent = eventType == EventType.DragPerform; bool isDropEvent = eventType == EventType.DragPerform;
UnityEditor.DragAndDrop.visualMode = DragAndDropVisualMode.Copy;
if (isDraggingEvent || isDropEvent) { if (isDraggingEvent || isDropEvent) {
var mouseOverWindow = EditorWindow.mouseOverWindow; var mouseOverWindow = EditorWindow.mouseOverWindow;
@ -319,12 +320,10 @@ namespace Spine.Unity.Editor {
const string GenericDataTargetID = "target"; const string GenericDataTargetID = "target";
if (HierarchyWindow.Equals(mouseOverWindow.GetType().ToString(), System.StringComparison.Ordinal)) { if (HierarchyWindow.Equals(mouseOverWindow.GetType().ToString(), System.StringComparison.Ordinal)) {
if (isDraggingEvent) { if (isDraggingEvent) {
UnityEditor.DragAndDrop.visualMode = DragAndDropVisualMode.Copy;
var mouseOverTarget = UnityEditor.EditorUtility.InstanceIDToObject(instanceId); var mouseOverTarget = UnityEditor.EditorUtility.InstanceIDToObject(instanceId);
if (mouseOverTarget) if (mouseOverTarget)
DragAndDrop.SetGenericData(GenericDataTargetID, mouseOverTarget); DragAndDrop.SetGenericData(GenericDataTargetID, mouseOverTarget);
// note: do not use the current event, otherwise we lose the nice mouse-over highlighting. // Note: do not call current.Use(), otherwise we get the wrong drop-target parent.
} else if (isDropEvent) { } else if (isDropEvent) {
var parentGameObject = DragAndDrop.GetGenericData(GenericDataTargetID) as UnityEngine.GameObject; var parentGameObject = DragAndDrop.GetGenericData(GenericDataTargetID) as UnityEngine.GameObject;
Transform parent = parentGameObject != null ? parentGameObject.transform : null; Transform parent = parentGameObject != null ? parentGameObject.transform : null;
@ -334,12 +333,10 @@ namespace Spine.Unity.Editor {
return; return;
} }
} }
} }
} }
} }
} }
} }
} }
} }