Skip to content

Commit 768d7a5

Browse files
committed
Cheat call spine internal function
1 parent ad1784f commit 768d7a5

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

Assets/AxieInfinity/AxieMixerUnity/Components/Builder/Axie2dBuilder.cs

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
using System;
22
using System.Collections.Generic;
33
using System.Linq;
4+
using System.Reflection;
45
using AxieCore.AxieMixer;
56
using Spine.Unity;
67
using UnityEngine;
@@ -165,8 +166,13 @@ SkeletonDataAsset CreateMixedSkeletonDataAsset(MixedSkeletonData mixed, float sc
165166
Scale = scale
166167
};
167168
var loadedSkeletonData = skeletonMixed.ReadSkeletonData(mixed, true);
168-
skeletonDataAsset.InitializeWithData(loadedSkeletonData);
169169

170+
//phuongnk - cheat to call internal function
171+
skeletonDataAsset.skeletonJSON = new TextAsset();
172+
Type thisType = skeletonDataAsset.GetType();
173+
var theMethod = thisType.GetMethod("InitializeWithData", BindingFlags.NonPublic | BindingFlags.Public | BindingFlags.Instance);
174+
theMethod.Invoke(skeletonDataAsset, new object[] { loadedSkeletonData });
175+
//skeletonDataAsset.InitializeWithData(loadedSkeletonData);
170176
return skeletonDataAsset;
171177
}
172178
catch (Exception ex)

0 commit comments

Comments
 (0)