|
Set a block of pixel colors.
This function takes a Color32 array and changes the pixel colors of the whole mip level of the texture. Call Apply to actually upload the changed pixels to the graphics card.
The colors array is a flattened 2D array, where pixels are laid out left to right, bottom to top (i.e. row after row). Array size must be at least width by height of the mip level used. The default mip level is zero (the base texture) in which case the size is just the size of the texture. In general case, mip level size is mipWidth=max(1,width>>miplevel) and similarly for height.
This function works only on ARGB32 texture formats. For other formats SetPixels32 is ignored. The texture also has to have Is Readable flag set in the import settings.
Using SetPixels32 is faster than calling SetPixels.
See Also: SetPixels, GetPixels32, GetPixels, Apply, mipmapCount.