Exemplo n.º 1
0
        private static bool TryGetDecalMaterial(MyDecalMaterialId decalMatId, out MyDecalMaterial decalMaterial)
        {
            bool found = m_decalMaterials.TryGetValue(decalMatId, out decalMaterial);

            if (found)
            {
                return(true);
            }

            if (decalMatId.Target != String.Empty)
            {
                // First fallback: try to find a source specific decal material
                MyDecalMaterialId temp = decalMatId;
                temp.Target = String.Empty;
                found       = m_decalMaterials.TryGetValue(temp, out decalMaterial);
                if (found)
                {
                    return(true);
                }
            }

            if (decalMatId.Source != String.Empty)
            {
                // First fallback: try to find a target specific decal material
                MyDecalMaterialId temp = decalMatId;
                temp.Source = String.Empty;
                found       = m_decalMaterials.TryGetValue(temp, out decalMaterial);
                if (found)
                {
                    return(true);
                }
            }

            return(false);
        }
Exemplo n.º 2
0
        public static bool TryGetDecalMaterial(string target, string source, out MyDecalMaterial decalMaterial)
        {
            var decalMatId = new MyDecalMaterialId()
            {
                Target = target, Source = source
            };

            return(TryGetDecalMaterial(decalMatId, out decalMaterial));
        }
Exemplo n.º 3
0
        public static void AddDecalMaterial(MyDecalMaterial decalMaterial)
        {
            var decalMatId = new MyDecalMaterialId()
            {
                Target = decalMaterial.Target.String, Source = decalMaterial.Source.String
            };

            m_decalMaterials[decalMatId] = decalMaterial;
        }
Exemplo n.º 4
0
        public static void AddDecalMaterial(MyDecalMaterial decalMaterial)
        {
            List<MyDecalMaterial> materials;
            bool found = m_decalMaterials.TryGetValue(decalMaterial.StringId, out materials);
            if (!found)
            {
                materials = new List<MyDecalMaterial>();
                m_decalMaterials[decalMaterial.StringId] = materials;
            }

            materials.Add(decalMaterial);
        }
Exemplo n.º 5
0
        public static void AddDecalMaterial(MyDecalMaterial decalMaterial)
        {
            List <MyDecalMaterial> materials;
            bool found = m_decalMaterials.TryGetValue(decalMaterial.StringId, out materials);

            if (!found)
            {
                materials = new List <MyDecalMaterial>();
                m_decalMaterials[decalMaterial.StringId] = materials;
            }

            materials.Add(decalMaterial);
        }