/// Copy this block of data into a Color[] array public void copy(Color[] color) { if (this.pixels.Length != color.Length) { // N.Console.Error("Buffer sizes do not match for color conversion"); return; } for (var i = 0; i < this._height * this._width; ++i) { PixelBlock.copy(this._buffer[i], out color[i]); } }
/// Create a new texture instance public Texture2D produce() { var rtn = new Texture2D(this._width, this._height, TextureFormat.ARGB32, false); if (this._pixels == null) { this._pixels = new Color[this._width * this._height]; var block = new PixelBlock(this._width, this._height); block.set(this._color); block.copy(this._pixels); } rtn.SetPixels(this._pixels, 0); this._pixels = null; rtn.Apply(); return rtn; }
/// Create a new texture instance public Texture2D produce() { var rtn = new Texture2D(this._width, this._height, TextureFormat.ARGB32, false); if (this._pixels == null) { this._pixels = new Color[this._width * this._height]; var block = new PixelBlock(this._width, this._height); block.set(this._color); block.copy(this._pixels); } rtn.SetPixels(this._pixels, 0); this._pixels = null; rtn.Apply(); return(rtn); }