Environment:
- Unity 6000.4.x
- Spine Unity Runtime 4.2
- Reproduced in a clean project
Steps to Reproduce:
- Create a new empty Unity project using Unity 6000.4.x.
- Import the Spine runtimes:
- Wait for the project to finish compiling.
- Create a few GameObjects in the scene hierarchy.
- Drag and drop a GameObject within the Hierarchy window (e.g. reparent it or move it between hierarchy items).
Actual Result
Unity throws the following exception during drag and drop operations in the Hierarchy:
ArgumentException: Object of type 'System.UInt64' cannot be converted to type 'System.Int32'
The stack trace points to SpineEditorUtilities.HierarchyHandler.HandleDragAndDrop and Unity’s drag-and-drop system.
Expected Result:
Hierarchy drag and drop operations should work normally without any exceptions.
Investigation:
The issue appears to be caused by the Spine editor integration registering an old int-based hierarchy drop handler:
HandleDragAndDrop(
int dropTargetInstanceID,
HierarchyDropFlags dropMode,
Transform parentForDraggedObjects,
bool perform)
Unity 6000.4 appears to have migrated hierarchy drag-and-drop callbacks to use UnityEngine.EntityId instead of an int instance ID.
I was able to eliminate the exception by adding a Unity 6000.4-specific implementation using:
DragAndDrop.AddDropHandlerV2(...)
DragAndDrop.RemoveDropHandlerV2(...)
and an EntityId-based callback wrapped in:
#if UNITY_6000_4_OR_NEWER
After this change, drag-and-drop operations in the Hierarchy work correctly and the exception no longer occurs.
This appears to be an editor-only compatibility issue with Unity 6000.4’s updated drag-and-drop API.
This is in SpineEditorUtilities.cs, inside HierarchyHandler.HandleDragAndDrop.
Spine Unity Runtime 4.3 works fine.