[unity] Make SkeletonDataAsset safer to create at runtime.

This commit is contained in:
pharan 2016-08-29 17:17:28 +08:00
parent 13f433d13d
commit ee324f4bde

View File

@ -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;