youmustfight / aframe-asset-lazy-load

An a-entity component to assign asset loading order and delays
https://youmustfight.github.io/aframe-asset-lazy-load/
MIT License
12 stars 6 forks source link

Removing need to query and filter all entities for lazy-load attribute #2

Open youmustfight opened 8 years ago

youmustfight commented 8 years ago

At the start of everything, I do a query for a-entities, and then filter the array if they have the attribute 'lazy-load'.

It seems redundant, since we know what entities have the attribute when components are being initialized. Ideally, I'd like to have the components push themselves in an array during their inits. Unfortunately though, I wasn't sure how a component would know if it was the last one (so it could initialize the loading sequence)