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

参数

tileX 区块 X 坐标。
tileY 区块 Y 坐标。
miplevel 纹理的多级渐进纹理级别。
data 区块颜色数据。

描述

使用颜色值更新稀疏纹理区块。

此函数使坐标为 (tileX,tileY) 的区块位于内存中,并且更新其像素。如果区块已经存在,则仅更新像素。

传入的数据应具有足够适合此区块的像素(tileWidth*tileHeight 个元素)。例外情况可能是小于区块大小的小多级渐进纹理级别;这不影响传入足以适合此 Mip 级别大小的数据。

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/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.

另请参阅:UnloadTileUpdateTileRaw

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