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); }
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); } }
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); } }