This sample demonstrates how to change a Material and Mesh on Entities at runtime. Enter Play mode to see the rendering change over different frames.
The scene contains two entities. One changes its Mesh and another changes its Material. The MeshChanger and MaterialChanger are the ECS scripts that perform the respective Mesh / Material swapping.
- In the Hierarchy, select the Subscene
- In the Inspector, click Open
- In the Hierarchy, select the MeshChange or MaterialChange GameObject
- In the Inspector, note that the Authoring components is attached
- Close the Subscene and enter Play mode. These two GameObjects are baked to Entities and change their mesh and material using the ECS System