• Editor
  • Spine as generic 2D sprites

Hi,

I was wondering if I could use Spine as a 2D sprite atlas without hitting my game performance.

For example, I have 10 different little objects in my 2D side-scrolling game. Each object are displayed with different sprites. I can make a SkeletonData that have 10 different "animations," each "animations" are merely one image (in one frame) displaying a particular "sprite". For each object, I just have to select the right "animation" so the right sprite is displayed.

So, my question is: is it okay to do that ?
Lets say I have like 100 objects displayed on my screen, do Unity-Spine treat those "animation of one static image" as simple images ? Or do they generate the same overheat as real animations does ?

I hope i am clear enough.
Note: I want to use Spine as 2D textures atlas because I am already using Spine for real animation, but I want to use it for much simpler sprites because I am lazy.
I was wondering if I could save time using Spine everywhere.

Related Discussions
...

You could do that. You could have a skeleton with many images attached. You don't need animations, just have all images in a single slot and change which image is shown at runtime with Skeleton#setAttachment. You could even programmatically create the SkeletonData and attachments.

There isn't much overhead to doing this. There doesn't need to be any animation involved, but even if you used animations it would not be doing much work. In Unity each GameObject will have a mesh containing your one image. Unity's dynamic batching can batch across GameObjects, so draw calls will be minimized. Doing this should not be your bottleneck, if it is then doing it any other way will also still be your bottleneck.