From ee324f4bde7ffdf9f927fc665b7b0c9957aa1c86 Mon Sep 17 00:00:00 2001 From: pharan Date: Mon, 29 Aug 2016 17:17:28 +0800 Subject: [PATCH] [unity] Make SkeletonDataAsset safer to create at runtime. --- .../Assets/spine-unity/Asset Types/SkeletonDataAsset.cs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/spine-unity/Assets/spine-unity/Asset Types/SkeletonDataAsset.cs b/spine-unity/Assets/spine-unity/Asset Types/SkeletonDataAsset.cs index da8629261..2a06f8bd5 100644 --- a/spine-unity/Assets/spine-unity/Asset Types/SkeletonDataAsset.cs +++ b/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;