This page looks best with JavaScript enabled

Tweaking source code is a bliss

 ·  โ˜• 1 min read

There is an asset in Unity store, that tremendously helps to include and manage 2D animations. It is called Aseprite Animation Workflow. And it works flawlessly… until you need an animation not to loop. By default this is what happens during importing to Unity (see Assets/AsepriteAnimationWorkflow/Editor/Aseprite.cs)

1
2
var animSettings = AnimationUtility.GetAnimationClipSettings(animation);
animSettings.loopTime = true;

In Unity it looks like this, and the “Loop Time” option can not be changed:

Good part is that the code is editable, just as any other code in your project. So after changing it to

1
2
var animSettings = AnimationUtility.GetAnimationClipSettings(animation);
animSettings.loopTime = !name.ToLower().Contains("noloop");

and setting a “_noloop” suffix to a tag in Aseprite

the animation is imported with loop checkbox unchecked:

In the game it looks like this, the walking animation is looped, and standing animation plays just once.

Share on