Version: 2020.1
public bool Resize (int width, int height, TextureFormat format, bool hasMipMap);

描述

调整纹理大小。

Changes size of texture to width by height, format to textureFormat and optionally creates mipmaps. After resizing, texture pixels will be undefined. This function is very similar to the texture constructor, except it works on existing texture object.

调用 Apply 可实际将更改的像素上传到显卡。

纹理必须在 texture import settings 中设置 read/write enabled 标志。


public bool Resize (int width, int height);

描述

调整纹理大小。

将纹理大小更改为 width x /height/。 调整大小后,纹理像素将是未定义的。该函数与纹理构造函数极其相似, 但它适用于现有纹理对象。

调用 Apply 可实际将更改的像素上传到显卡。

纹理必须在导入设置中设置了 Is Readable 标志。

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