Engine generated graph nodes in entities (eg elements) causing issues with children length
Related to: https://github.com/playcanvas/engine/issues/1660
A user had an issue where some logic was dependent on the number of children that an element entity had.
Because a graph node is created by the engine for the mesh, the count was always off by one and took some time to work out that there was an extra graphnode that's not shown in the Editor but was created at runtime.
The proposal here is that we have a new API that only has the children that are entities unless anyone has other ideas to tackle this.
Just came across this code just now:

It uses render component to render UI, as it should .. but now we can remove the GraphNode it creates, and the render component would connect to the entity directly, instead of the graph node.
Would need testing, but should work. Other element components would need to be updated as well.
actually, after another look I realised this still internally uses a model component, and probably should be converted to a render component as well.
The proposal here is that we have a new API that only has the children that are entities unless anyone has other ideas to tackle this.
The better plan is to remove the use of the model / model component internally in the engine, which is what creates those extra nodes, and convert it all to use the render component, which uses the entity itself instead of an extra node.