Merge pull request #14574 from super626/v3

Fix Sprite3D::setMaterial when multiple meshes exist
This commit is contained in:
pandamicro 2015-12-04 17:38:56 +08:00
commit 6ff2586f26
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