mirror of https://github.com/axmolengine/axmol.git
Merge pull request #14574 from super626/v3
Fix Sprite3D::setMaterial when multiple meshes exist
This commit is contained in:
commit
6ff2586f26
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue