[unity] Fixed broken inspector preview in Unity7 2019. Closes #1331.

This commit is contained in:
Harald Csaszar 2019-04-17 18:09:20 +02:00
parent b99df7286a
commit 299ffc6de8
3 changed files with 15 additions and 1 deletions

View File

@ -30,7 +30,7 @@
#define SPINE_SKELETON_MECANIM
#if (UNITY_2017_4 || UNITY_2018)
#if (UNITY_2017_4 || UNITY_2018_1_OR_NEWER )
#define SPINE_UNITY_2018_PREVIEW_API
#endif

View File

@ -106,8 +106,13 @@ namespace Spine.Unity.Editor {
}
void OnSelectionChange () {
#if UNITY_2019_1_OR_NEWER
SceneView.duringSceneGui -= this.OnSceneGUI;
SceneView.duringSceneGui += this.OnSceneGUI;
#else
SceneView.onSceneGUIDelegate -= this.OnSceneGUI;
SceneView.onSceneGUIDelegate += this.OnSceneGUI;
#endif
bool noSkeletonRenderer = false;
@ -148,7 +153,11 @@ namespace Spine.Unity.Editor {
isPrefab = false;
boneName = string.Empty;
bone = null;
#if UNITY_2019_1_OR_NEWER
SceneView.duringSceneGui -= this.OnSceneGUI;
#else
SceneView.onSceneGUIDelegate -= this.OnSceneGUI;
#endif
}
void OnDestroy () {

View File

@ -201,8 +201,13 @@ namespace Spine.Unity.Editor {
Icons.Initialize();
// Drag and Drop
#if UNITY_2019_1_OR_NEWER
SceneView.duringSceneGui -= DragAndDropInstantiation.SceneViewDragAndDrop;
SceneView.duringSceneGui += DragAndDropInstantiation.SceneViewDragAndDrop;
#else
SceneView.onSceneGUIDelegate -= DragAndDropInstantiation.SceneViewDragAndDrop;
SceneView.onSceneGUIDelegate += DragAndDropInstantiation.SceneViewDragAndDrop;
#endif
EditorApplication.hierarchyWindowItemOnGUI -= HierarchyHandler.HandleDragAndDrop;
EditorApplication.hierarchyWindowItemOnGUI += HierarchyHandler.HandleDragAndDrop;