Version: 2018.2
public void UpdateTile (int tileX, int tileY, int miplevel, Color32[] data);

Parameters

tileXTile X coordinate.
tileYTile Y coordinate.
miplevelMipmap level of the texture.
dataTile 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.

Copyright © 2023 Unity Technologies
优美缔软件(上海)有限公司 版权所有
"Unity"、Unity 徽标及其他 Unity 商标是 Unity Technologies 或其附属机构在美国及其他地区的商标或注册商标。其他名称或品牌是其各自所有者的商标。
公安部备案号:
31010902002961