Skip to content

Commit 38ddb1a

Browse files
committed
[unity] Fixed removing custom SkeletonDataAsset mix duration leaving cached AnimationStateData out of sync. See #3191.
1 parent 1db700e commit 38ddb1a

4 files changed

Lines changed: 11 additions & 3 deletions

File tree

‎spine-csharp/src/AnimationStateData.cs‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,11 @@ public void SetMix (Animation from, Animation to, float duration) {
6969
animationToMixTime.Add(key, duration);
7070
}
7171

72+
/// <summary>Clears all previously set mix durations without changing <see cref="DefaultMix"/>.</summary>
73+
public void ClearMixes () {
74+
animationToMixTime.Clear();
75+
}
76+
7277
/// <summary>
7378
/// Returns the mix duration to use when changing from the specified animation to the other on the same track,
7479
/// or the <see cref="DefaultMix"/> if no mix duration has been set.

‎spine-csharp/src/package.json‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"name": "com.esotericsoftware.spine.spine-csharp",
33
"displayName": "spine-csharp Runtime",
44
"description": "This plugin provides the spine-csharp core runtime. Compatible with skeleton exports from Spine Editor version 4.3 or later.",
5-
"version": "4.3.41",
5+
"version": "4.3.42",
66
"unity": "2018.3",
77
"author": {
88
"name": "Esoteric Software",

‎spine-unity/Assets/Spine/Runtime/spine-unity/Asset Types/SkeletonDataAsset.cs‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -249,6 +249,9 @@ internal void InitializeWithData (SkeletonData sd) {
249249

250250
public void FillStateData (bool quiet = false) {
251251
if (stateData != null) {
252+
#if UNITY_EDITOR
253+
stateData.ClearMixes();
254+
#endif
252255
stateData.DefaultMix = defaultMix;
253256

254257
for (int i = 0, n = fromAnimation.Length; i < n; i++) {

‎spine-unity/Assets/Spine/package.json‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"name": "com.esotericsoftware.spine.spine-unity",
33
"displayName": "spine-unity Runtime",
44
"description": "This plugin provides the spine-unity runtime core and examples. Spine Examples can be installed via the Samples tab.",
5-
"version": "4.3.116",
5+
"version": "4.3.117",
66
"unity": "2018.3",
77
"author": {
88
"name": "Esoteric Software",
@@ -14,7 +14,7 @@
1414
"com.unity.modules.animation" : "1.0.0",
1515
"com.unity.modules.physics" : "1.0.0",
1616
"com.unity.modules.physics2d" : "1.0.0",
17-
"com.esotericsoftware.spine.spine-csharp" : "4.3.36",
17+
"com.esotericsoftware.spine.spine-csharp" : "4.3.42",
1818
"com.unity.2d.sprite": "1.0.0"
1919
},
2020
"repository": {

0 commit comments

Comments
 (0)