コード例 #1
0
ファイル: ModelInstance.cs プロジェクト: BaronVonTeapot/Basic
        /// <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;
                }
            }
        }
コード例 #2
0
ファイル: ModelInstance.cs プロジェクト: BaronVonTeapot/Basic
 /// <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);
     }
 }