Esempio n. 1
0
            private void AddToCache(WorkingMaterial material)
            {
                string         inputName = m_textureInfoList[0].InputName;
                WorkingTexture texture   = material.GetTexture(inputName);

                if (texture == null)
                {
                    texture = m_defaultTextures[m_textureInfoList[0].Type];
                }

                TexturePacker.MaterialTexture materialTexture = new TexturePacker.MaterialTexture();

                if (m_enableTintColor)
                {
                    Color tintColor = material.GetColor(m_tintColorName);

                    texture = texture.Clone();
                    ApplyTintColor(texture, tintColor);
                    materialTexture.Add(texture);
                    texture.Dispose();
                }
                else
                {
                    materialTexture.Add(texture);
                }


                for (int ti = 1; ti < m_textureInfoList.Count; ++ti)
                {
                    string         input = m_textureInfoList[ti].InputName;
                    WorkingTexture tex   = material.GetTexture(input);

                    if (tex == null)
                    {
                        tex = m_defaultTextures[m_textureInfoList[ti].Type];
                    }

                    materialTexture.Add(tex);
                }

                m_textureCache.Add(material.Guid, materialTexture);
            }
Esempio n. 2
0
 public void Add(WorkingTexture texture)
 {
     m_textures.Add(texture.Clone());
 }