fix Sprite3D::setMaterial

This commit is contained in:
yangxiao 2015-12-04 10:54:43 +08:00
parent 40865ad88f
commit 8d546828f4
1 changed files with 2 additions and 2 deletions

View File

@ -457,9 +457,9 @@ void Sprite3D::setMaterial(Material *material, int meshIndex)
if (meshIndex == -1)
{
for (auto mesh: _meshes)
for (size_t i = 0; i < _meshes.size(); i++)
{
mesh->setMaterial(material);
_meshes.at(i)->setMaterial(i == 0 ? material : material->clone());
}
}
else