LoginSignup
2
2

More than 3 years have passed since last update.

[Unity de Spine] 落下から着地時の補間アニメーションからループアニメーションへのつなぎ方

Posted at

個人開発でSpineを使うかもしれないので備忘録

Spine SDK version: spine-unity-3_7-2019-04-18
Unity version: 2018.3.2f1

補間有りと無しの違い

Exampleでは高いところから落下するとしゃがみアニメーションに遷移します。
補間ありの方は落下からしゃがみへの遷移するアニメーションがありますが無い方は落下からしゃがみアニメーションにすぐに切り替わっています。

補間アニメーションあり

補間アニメーションなし

補間アニメーションありの実装の仕方

Spineでは連続したアニメーションの再生ができる為、次のようにすると補間アニメーションの後に通常のアニメーションが再生されるようになります。

skeletonAnimation.AnimationState.SetAnimation(0, transitionAnimation, false);
skeletonAnimation.AnimationState.AddAnimation(0, nextAnimation, true, 0);

 補間無しの場合

補間無しの場合はこんな感じでやればとりあえず出来ます。

var trackIndex = 0;
var isLoop = true;
skeletonAnimation.AnimationState.SetAnimation(trackIndex, nextAnimation, isLoop);

参考

2
2
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
2
2