unity replace array elemes code example Example: array replace unity intMaterials = new Material[cachedMaterial.Length]; for(int i=0; i