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

This commit is contained in:
Harald Csaszar 2024-06-19 18:58:09 +02:00
parent 0337d4a029
commit 5d37fac0fc
2 changed files with 11 additions and 3 deletions

View File

@ -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;
@ -590,9 +594,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));
}
}

View File

@ -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.2.71",
"version": "4.2.72",
"unity": "2018.3",
"author": {
"name": "Esoteric Software",