Legacy Documentation: Version 5.4
LanguageEnglish
  • C#
  • JS

Script language

Select your preferred scripting language. All code snippets will be displayed in this language.

SparseTexture.UpdateTile

Suggest a change

Success!

Thank you for helping us improve the quality of Unity Documentation. Although we cannot accept all submissions, we do read each suggested change from our users and will make updates where applicable.

Close

Sumbission failed

For some reason your suggested change could not be submitted. Please try again in a few minutes. And thank you for taking the time to help us improve the quality of Unity Documentation.

Close

Cancel

public function UpdateTile(tileX: int, tileY: int, miplevel: int, data: Color32[]): void;
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.
data Tile color data.

Description

Update sparse texture tile with color values.

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 UpdateTileRaw and pass raw tile data bytes (e.g. DXT-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.

See Also: UnloadTile, UpdateTileRaw.