Browse Source

[unity] Fixed Bone Name selector only displaying root bone on Unity 2023.2. Closes #2556.

Harald Csaszar 1 year ago
parent
commit
0285625934

+ 10 - 2
spine-unity/Assets/Spine/Editor/spine-unity/Editor/SpineAttributeDrawers.cs

@@ -29,6 +29,10 @@
 
 // Contributed by: Mitch Thompson
 
+#if UNITY_2023_2_OR_NEWER
+#define MENU_REQUIRES_DIFFERENT_NESTED_NAME
+#endif
+
 using Spine;
 using System;
 using System.Collections.Generic;
@@ -587,9 +591,13 @@ namespace Spine.Unity.Editor {
 					// jointName = "root/hip/bone" to show a hierarchial tree.
 					string jointName = name;
 					BoneData iterator = bone;
-					while ((iterator = iterator.Parent) != null)
+					while ((iterator = iterator.Parent) != null) {
+#if MENU_REQUIRES_DIFFERENT_NESTED_NAME
+						jointName = string.Format("{0} /{1}", iterator.Name, jointName);
+#else
 						jointName = string.Format("{0}/{1}", iterator.Name, jointName);
-
+#endif
+					}
 					menu.AddItem(new GUIContent(jointName), !property.hasMultipleDifferentValues && name == property.stringValue, HandleSelect, new SpineDrawerValuePair(name, property));
 				}
 			}

+ 1 - 1
spine-unity/Assets/Spine/package.json

@@ -2,7 +2,7 @@
 	"name": "com.esotericsoftware.spine.spine-unity",
 	"displayName": "spine-unity Runtime",
 	"description": "This plugin provides the spine-unity runtime core.",
-	"version": "4.1.42",
+	"version": "4.1.43",
 	"unity": "2018.3",
 	"author": {
 		"name": "Esoteric Software",