I’m basically looking for the ECS approach to do something.
I’m making a 2D animation system and each component of “SpriteSheetData” is a shared component with different instances per unit. It stores things like the number of cells on a spreadsheet and cell height/width.
Importantly I have a struct called AnimationClip which contains the start cell, end cell, direction and speed of an animation, the cell numbers linking to sprite-sheet data. Now every instance of SpriteSheetData may contain multiple animation clips (walking, jumping, etc.)
So essentially I have a shared SpriteSheetData component between identical units, inside that I need a dynamic array of AnimationClips (currently just a struct but should this also be a shared component?)
So that if I have 2 say goblin enemies, they share the same SpriteSheetData and AnimationClip array, the only thing that needs to be different between them is the current clip, their own frame timers, and their current frame in the animation.
What’s the ECS way to set this up?