Эх сурвалжийг харах

[unity] Make SkeletonDataAsset safer to create at runtime.

pharan 9 жил өмнө
parent
commit
ee324f4bde

+ 5 - 0
spine-unity/Assets/spine-unity/Asset Types/SkeletonDataAsset.cs

@@ -161,6 +161,11 @@ namespace Spine.Unity {
 				return;
 
 			stateData.DefaultMix = defaultMix;
+
+			// For compatibility with runtime-instantiated SkeletonDataAsset.
+			if (fromAnimation == null || toAnimation == null)
+				return;
+
 			for (int i = 0, n = fromAnimation.Length; i < n; i++) {
 				if (fromAnimation[i].Length == 0 || toAnimation[i].Length == 0)
 					continue;