I want to make my items clickable. I know how to make spatials clickabel. How can I get the entity in ES based game? My first thought here was to store the entityid as a userdata in the spatial. as soon as I click it I can get the entity id from spatials userdata if exist and add a new entity with IsClicked component and a Decay component to shortly highlight it with a Highlighting system.
So why ask when I have the solution? Because there is a downside as I have clickable and non clickable spatials but all as entities with position model and so on. I would need to store the the entity in my visual appstate and not for all of them only a subset (items only). So I would end with a maybe two visual systems one for items one for the rest. Or I would have to get the Item component in visuals with ed.getComponent(e, Item.class). Or do think to far and this the way going. Is there a better solution?