Пример #1
0
            public MaterialTexture Clone()
            {
                MaterialTexture nmt = new MaterialTexture();

                for (int i = 0; i < m_textures.Count; ++i)
                {
                    nmt.Add(m_textures[i]);
                }

                return(nmt);
            }
Пример #2
0
            private DisposableList <MaterialTexture> CreateResizedTextures(int newWidth, int newHeight)
            {
                DisposableList <MaterialTexture> resized = new DisposableList <MaterialTexture>();

                for (int i = 0; i < m_textures.Count; ++i)
                {
                    MaterialTexture newMT = new MaterialTexture();

                    for (int k = 0; k < m_textures[i].Count; ++k)
                    {
                        int            targetWidth    = Mathf.Min(newWidth, m_textures[i][k].Width);
                        int            targetHeight   = Mathf.Min(newHeight, m_textures[i][k].Height);
                        WorkingTexture resizedTexture =
                            m_textures[i][k].Resize(Allocator.Persistent, targetWidth, targetHeight);
                        newMT.Add(resizedTexture);
                        resizedTexture.Dispose();
                    }

                    resized.Add(newMT);
                }

                return(resized);
            }