Uni2DEditorTextureAtlasPacker:Uni2D图集打包工具。仅用于编辑器下自动打包。Uni2D图片打包采用了开源打包项目MaxRectsBinPack.cpp的源码,有Sven Magnus移植到C#版本。研究打包模式的话可以了解下这个,采用的打包模式如下:
public enum FreeRectChoiceHeuristic
{
RectBestShortSideFit,///< -BSSF: Positions the rectangle against the short side of a free rectangle into which it fits the best.
RectBestLongSideFit,///< -BLSF: Positions the rectangle against the long side of a free rectangle into which it fits the best.
RectBestAreaFit,///< -BAF: Positions the rectangle into the smallest free rect into which it fits.
RectBottomLeftRule,///< -BL: Does the Tetris placement.
RectContactPointRule///< -CP: Choosest the placement where the rectangle touches other rects as much as possible.
};