Documentation

Unity Engine


User Manual

Script Reference

Unity Engine


UpdateTile(int, int, int, Color32[])

Update sparse texture tile with color values.
Read time 1 minuteLast updated 12 days ago

Definition

  • Type: Method
  • Namespace: UnityEngine
  • Assembly: UnityEngine.CoreModule
public void UpdateTile(int tileX, int tileY, int miplevel, Color32[] data)

Parameters

tileX

Tile X coordinate.

tileY

Tile Y coordinate.

miplevel

Mipmap level of the texture.

Tile color data.

Remarks

This function makes a tile at (tileX,tileY) coordinates resident in memory, and updates its pixels. If a tile is already resident, then only the pixels are updated.
Data passed should have enough pixels for the tile (tileWidth*tileHeight elements). Exception can be small mipmap levels that are smaller than tile size; then it's ok to pass enough data for the mip level size.
UpdateTile only works for non-compressed color formats. If you use a sparse texture with a compressed format, use SparseTexture.UpdateTileRaw and pass raw tile data bytes (e.g. DXT/BCn-compressed data). UpdateTileRaw can also be more efficient if texture format is not RGBA32, as then Unity does not have to convert from Color32 data into the underlying texture format.