Selaa lähdekoodia

[csharp] Fixed interrupting a mix with mixDuration 0.

Port of https://github.com/EsotericSoftware/spine-runtimes/commit/c8d595565b2fd982ca27ef4d04dabc1366fe8026
closes https://github.com/EsotericSoftware/spine-runtimes/issues/970
John 8 vuotta sitten
vanhempi
commit
50730c7a5c
1 muutettua tiedostoa jossa 3 lisäystä ja 2 poistoa
  1. 3 2
      spine-csharp/src/AnimationState.cs

+ 3 - 2
spine-csharp/src/AnimationState.cs

@@ -139,8 +139,9 @@ namespace Spine {
 			bool finished = UpdateMixingFrom(from, delta);
 
 			// Require mixTime > 0 to ensure the mixing from entry was applied at least once.
-			if (to.mixTime > 0 && (to.mixTime >= to.mixDuration || to.timeScale == 0)) {	
-				if (from.totalAlpha == 0) {
+			if (to.mixTime > 0 && (to.mixTime >= to.mixDuration || to.timeScale == 0)) {
+				// Require totalAlpha == 0 to ensure mixing is complete, unless mixDuration == 0 (the transition is a single frame).
+				if (from.totalAlpha == 0 || to.mixDuration == 0) {
 					to.mixingFrom = from.mixingFrom;
 					to.interruptAlpha = from.interruptAlpha;
 					queue.End(from);