Version: 2020.3

Texture2D.GenerateAtlas

切换到手册
public static bool GenerateAtlas (Vector2[] sizes, int padding, int atlasSize, List<Rect> results);

参数

sizes 一个包含矩形大小的数组。
padding 在图集中相邻矩形之间插入的填充量。
atlasSize 图集的大小。
results If the function succeeds, Unity populates this with the packed rectangles.

返回

bool Returns true if the function succeeds. Otherwise, returns false.

描述

将一组矩形打包成一个方形图集,并且可以选择在矩形之间进行填充。

另请参阅:PackTextures