[关闭]
@daaoling 2016-09-07T22:49:58.000000Z 字数 653 阅读 1688

Unity-NGUI

NGUI Python 批量打包图集(rotating)

TP 批量打包

image_1as2gnqi3fen13f6d25ulg1pg09.png-34.8kB

根据模板 对config.json 目录下的散图进行批量打包

代码下载

https://git.oschina.net/daao/Python_StudyRoadMap/tree/master/Texturepacker_toNGUI

修改ngui 支持rotating

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));
    }
}
添加新批注
在作者公开此批注前,只有你和作者可见。
回复批注