@daaoling
2016-09-07T22:49:58.000000Z
字数 653
阅读 1688
Unity-NGUI
根据模板 对config.json 目录下的散图进行批量打包
代码下载
https://git.oschina.net/daao/Python_StudyRoadMap/tree/master/Texturepacker_toNGUI
UISprite.cs
public override void SimpleFill(BetterList<Vector3> verts, BetterList<Vector2> uvs, BetterList<Color32> cols)
{
Vector4 v = drawingDimensions;
Vector4 u = drawingUVs;
Color32 c = drawingColor;
if (mSprite.rotated)
{
verts.Add(new Vector3(-1.0f * v.y, v.x));
verts.Add(new Vector3(-1.0f * v.w, v.x));
verts.Add(new Vector3(-1.0f * v.w, v.z));
verts.Add(new Vector3(-1.0f * v.y, v.z));
}
else
{
verts.Add(new Vector3(v.x, v.y));
verts.Add(new Vector3(v.x, v.w));
verts.Add(new Vector3(v.z, v.w));
verts.Add(new Vector3(v.z, v.y));
}
}