[unity] Handle animation not found.

This commit is contained in:
John 2017-12-21 07:11:24 +08:00 committed by GitHub
parent 45c67ee4bc
commit 613b098b53
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -161,8 +161,11 @@ namespace Spine.Unity {
}
#else
if (!string.IsNullOrEmpty(_animationName)) {
state.SetAnimation(0, _animationName, loop);
Update(0);
var animationObject = skeletonDataAsset.GetSkeletonData(false).FindAnimation(_animationName);
if (animationObject != null) {
state.SetAnimation(0, animationObject, loop);
Update(0);
}
}
#endif
}