AetherInteractiveLtd/Tina

ECS: Create entity "prefabs"

Opened this issue · 2 comments

Entity "prefabs" would be a collection of components that could be added to an entity. For example, if we wanted to create an "lamp" entity that always needed a Position, Renderable, Interactable, and Light component, we could just add the collection of components to the entity, rather than needing to add every component individually.

Yeah I've been wanting to do this a lot, do you have an API that you're working on?

https://github.com/AetherInteractiveLtd/Tina/tree/feat-prefabs

This was an initial idea, where we basically just store them as an array of components. This was from a while back; I just pulled out my stash. I never properly figured out if this was the best approach though.