protected void RestorePartEffectMapping(PartEffectMapping mapping) { foreach (ModelMesh mesh in Model.Meshes) { foreach (ModelMeshPart meshPart in mesh.MeshParts) { meshPart.Effect = mapping[meshPart]; } } }
protected PartEffectMapping CurrentPartEffectMapping() { PartEffectMapping mapping = new PartEffectMapping(); foreach (ModelMesh mesh in Model.Meshes) { foreach (ModelMeshPart meshPart in mesh.MeshParts) { mapping[meshPart] = meshPart.Effect; } } return(mapping); }