コード例 #1
0
        public static void RegisterMaterials(Dictionary <string, List <MyDecalMaterialDesc> > descriptions)
        {
            m_materials.Clear();
            foreach (var pair in descriptions)
            {
                List <MyDecalTextures> list = new List <MyDecalTextures>();
                foreach (var desc in pair.Value)
                {
                    list.Add(new MyDecalTextures()
                    {
                        DecalType         = MyMeshMaterials1.GetMaterialTextureTypes(desc.NormalmapTexture, desc.ColorMetalTexture, desc.ExtensionsTexture, null),
                        NormalmapTexture  = desc.NormalmapTexture,
                        ColorMetalTexture = desc.ColorMetalTexture,
                        ExtensionsTexture = desc.ExtensionsTexture,
                        AlphamaskTexture  = desc.AlphamaskTexture,
                    });
                }

                m_materials[X.TEXT_(pair.Key)] = list;
            }
        }
コード例 #2
0
ファイル: MyScreenDecals.cs プロジェクト: viktorius/Viktor
        public static void RegisterMaterials(Dictionary <string, List <MyDecalMaterialDesc> > descriptions)
        {
            MyFileTextureManager texManager = MyManagers.FileTextures;

            m_materials.Clear();
            foreach (var pair in descriptions)
            {
                List <MyDecalTextures> list = new List <MyDecalTextures>();
                foreach (var desc in pair.Value)
                {
                    list.Add(new MyDecalTextures()
                    {
                        DecalType         = MyMeshMaterials1.GetMaterialTextureTypes(desc.ColorMetalTexture, desc.NormalmapTexture, desc.ExtensionsTexture, null),
                        ColorMetalTexture = texManager.GetTexture(desc.ColorMetalTexture, MyFileTextureEnum.COLOR_METAL),
                        NormalmapTexture  = texManager.GetTexture(desc.NormalmapTexture, MyFileTextureEnum.NORMALMAP_GLOSS),
                        ExtensionsTexture = texManager.GetTexture(desc.ExtensionsTexture, MyFileTextureEnum.EXTENSIONS),
                        AlphamaskTexture  = texManager.GetTexture(desc.AlphamaskTexture, MyFileTextureEnum.ALPHAMASK),
                    });
                }

                m_materials[X.TEXT_(pair.Key)] = list;
            }
        }