Ejemplo n.º 1
0
        /// <summary>
        /// Stores a Material in the temporary cache for later use.
        /// </summary>
        /// <param name="inMeshName">Name of the mesh.</param>
        /// <param name="inMaterial">Material to cache.</param>
        protected void SetMeshMaterial(string inMeshName, Material inMaterial)
        {
            foreach (ModelMesh modelMesh in this.Model.Meshes)
            {
                if (inMeshName != modelMesh.Name) { continue; }

                foreach (ModelMeshPart meshPart in modelMesh.MeshParts) {
                    ((MeshTag)meshPart.Tag).CachedMaterial = inMaterial;
                }
            }
        }
Ejemplo n.º 2
0
 /// <summary>
 /// Store a Material in the temporary cache for later use.
 /// </summary>
 /// <param name="inMaterial">Material to cache.</param>
 public void SetModelMaterial(Material inMaterial)
 {
     foreach (ModelMesh modelMesh in this.Model.Meshes)
     {
         this.SetMeshMaterial(modelMesh.Name, inMaterial);
     }
 }