错误的做法:
for(int i = 0; i < _skinnedMeshRenderer.materials.length; ++i)
{
_skinnedMeshRenderer.materials[i] = listMats[i];
}
正确的做法,必须整个数组一起替换
_skinnedMeshRenderer.materials = listMats.ToArray();
错误的做法:
for(int i = 0; i < _skinnedMeshRenderer.materials.length; ++i)
{
_skinnedMeshRenderer.materials[i] = listMats[i];
}
正确的做法,必须整个数组一起替换
_skinnedMeshRenderer.materials = listMats.ToArray();