Esempio n. 1
0
        public Material PickMaterial(Decal canvas, out bool isDirty)
        {
            var  size = new DecalSize(canvas.decalTexture.width, canvas.decalTexture.height);
            Pool pool;

            if (m_pool.TryGetValue(size, out pool))
            {
                return(pool.Pick(out isDirty));
            }
            isDirty = false;
            return(null);
        }
Esempio n. 2
0
        public void RegisterDecal(DecalCanvas canvas)
        {
            var size = new DecalSize(canvas.decal.width, canvas.decal.height);

            if (m_pool.ContainsKey(size))
            {
                var pool = m_pool[size];
                pool.AddMaterial();
            }
            else
            {
                var pool = new Pool(canvas.decalMaterial, 10);
                m_pool.Add(size, pool);
            }
        }
Esempio n. 3
0
        public void RegisterDecal(Decal canvas)
        {
            var size       = new DecalSize(canvas.decalTexture.width, canvas.decalTexture.height);
            var pixelCount = size.width * size.height;

            if (!m_blankCache.ContainsKey(pixelCount))
            {
                var colorArray = new Color32[pixelCount];
                m_blankCache.Add(pixelCount, colorArray);
            }
            if (m_pool.ContainsKey(size))
            {
                var pool = m_pool[size];
                pool.AddMaterial();
            }
            else
            {
                var pool = new Pool(canvas.decalMaterial, 10);
                m_pool.Add(size, pool);
            }
        }