Hi there,
I quite new to ECS / DOTS, so first of all, apologies if the question I am about to ask is already answered.
My use case - I would like to create I bunch of entities from the existing prefab and for each entity, I would like to set:
Position
Scale
Color
Now, I already saw how I can set the position:
manager.SetComponentData(rotatingCubeEntity, new Translation { Value = new float3(posX, 0.0f, posZ) });
However, I have issue to find how to set scale and color.
For scale, I can see, I can create an entity archetype and to include Scale, however, looking at Unity.Transforms.Scale struct, I can see just a single Value, so it is not clear to me how I can scale in 3-dimensional world.
Regarding the color - the way I found, the color is set is basically like that:
however, with this approach, since the renderMesh is shared among all entities, I set the new color to all entities. So basically I have all entities in the same color.
I would appreciate either a scripting example or reference to the existing one.
Thanks
Regarding the scale you should read this, the short version is that you probably want the NonUniformScale component. Per-instance color is more complicated. The hybrid renderer only supports per-instance data in HDRP right now and it’s most definitely not beginner friendly to get it working. See this thread for more information.
Thanks, @digitaliliad and @Sarkahn_1 for your answers. I found the latter thread very informative since I am also using LWRP / URP in my project - something I forgot to mention. So basically, ECS in terms of dynamic rendering for URP is way too far from being implemented. Am I correct?