Closed foxor closed 4 months ago
The reason of such a solution was to simplify authoring process. Most of animation sprite sheets comes in frame order with constant frame size. Cases where same frame can be used in different animations are rare I believe. Though I've thought about such a solution as an alternative for current animation system but no one ever make a request to me to implement that. I think there can be 2 animation system and 2 bakers. One for recalculating UVs and one for keeping them in blob array.
The current implementation requires that sprites appear in animation order within the source texture. There is no reason to require this, and compliance with this constraint can waste GPU memory if a frame is used in multiple animations. The purpose of the system is to determine the frame TextureST, but all you need to do that is a sprite. You can just take an array of sprites from unity's existing sprite pipeline, like so:
BakerExtension.cs :
SpriteUVAnimationSystem.cs: