Hi,
I’ve got a simple script which on Start() creates 1000 cubes with 6 materials each (one for each face) from a prefab to just test out some performance stuff. I was trying to loop through the materials and turn the shader off by script basically but I was actually not finding an increase in FPS in my test scenes.
I found that just having this line on my cube’s Start() class is having a huge hit on the performance even after all the cubes have finished their Start methods:
private void Start()
{
foreach (Material m in GetComponent<Renderer>().materials)
{
}
}
Just having this empty loop in the Start method means even after the start menu on my test scene I go from about 80ms to 200ms, could anyone explain what’s going on and maybe a more efficient way I can handle this?