@@ -21,9 +21,10 @@ public AtlasImageDuplicateSpriteName(string message):base(message){
21
21
}
22
22
23
23
public class SpineUtil {
24
- public static string SLOT_PREFIX = "slot" ;
25
- public static string SKIN_PREFIX = "skin" ;
26
- public static string ANIMATION_FOLDER = "animation" ;
24
+ public static string SLOT_PREFIX = "slot" ;
25
+ public static string SKIN_PREFIX = "skin" ;
26
+ public static string ANIMATION_FOLDER = "animation" ;
27
+ public static string SLASH_REPLACEMENT = "|" ;
27
28
28
29
public static Vector2 lineToVector2 ( string line ) {
29
30
string [ ] xy = null ;
@@ -297,17 +298,18 @@ public static void addAllAttahcmentsSlots(SpineData spineData, SpritesByName spr
297
298
298
299
GameObject parentGO ;
299
300
GameObject spriteGO ;
301
+ string fixedName = attachmenName . Replace ( "/" , SLASH_REPLACEMENT ) ;
300
302
if ( isDefault ) {
301
303
parentGO = slotGO ;
302
- spriteGO = new GameObject ( attachmenName ) ;
304
+ spriteGO = new GameObject ( fixedName ) ;
303
305
Attachment a = new Attachment ( attachmenName , AttachmentType . SINGLE_SPRITE , spriteGO ) ;
304
306
slot . addAttachment ( a ) ;
305
307
} else {
306
308
spriteGO = new GameObject ( skinName ) ;
307
309
Attachment a ;
308
310
slot . attachmentByName . TryGetValue ( attachmenName , out a ) ;
309
311
if ( a == null ) {
310
- GameObject attachmentGO = new GameObject ( attachmenName ) ;
312
+ GameObject attachmentGO = new GameObject ( fixedName ) ;
311
313
attachmentGO . transform . parent = slotGO . transform ;
312
314
resetLocalTRS ( attachmentGO ) ;
313
315
a = new Attachment ( attachmenName , AttachmentType . SKINED_SPRITE , attachmentGO ) ;
@@ -467,7 +469,8 @@ public static void addSlotAnimationToClip(AnimationClip
467
469
foreach ( KeyValuePair < string , AnimationCurve > kvp2 in curveByName ) {
468
470
string attachmentName = kvp2 . Key ;
469
471
AnimationCurve animationCurve = kvp2 . Value ;
470
- string attachmentPath = spineData . slotPathByName [ slotName ] + "/" + attachmentName ;
472
+ string attachmentPath = spineData . slotPathByName [ slotName ] + "/" + attachmentName . Replace ( "/" , SLASH_REPLACEMENT ) ;
473
+ Debug . Log ( attachmentPath ) ;
471
474
clip . SetCurve ( attachmentPath , typeof ( GameObject ) , "m_IsActive" , animationCurve ) ;
472
475
}
473
476
0 commit comments