Simple RealityKit 2 ECS example that rotates a simple cube using a Rotate Component?

The new RealityKit 2 ECS enhancements from #WWDC21 are awesome but to learn them I need a simple example!

Could someone please post a simple RealityKit 2 ECS example that rotates a simple cube using a Rotate Component?

If the Rotate Component is added then the cube should rotate.

If the Rotate Component is removed then the cube should stop rotating.

I recommend that you check out the Implementing Systems for Entities in a Scene article if you have not already. It doesn't really contain a concrete example, but it does provide a focused explanation of how you can implement a System.

There is also the larger Building an Immersive Experience with RealityKit sample which does contain a few concrete System implementations. If you still feel that you need a more focused and concrete System based sample project, please file an enhancement request using Feedback Assistant :)

Simple RealityKit 2 ECS example that rotates a simple cube using a Rotate Component?
 
 
Q