Beispiel #1
0
    public override string ExportFrame(int index)
    {
        string extraStr;

        if (image.color == Color.white)
        {
            extraStr = "";
        }
        else
        {
            extraStr = string.Format(", color={0}", image.color.ToBGRA());
        }

        E2DSprite e2DSprite;

        if (E2DPackage.active.spriteRefMap.TryGetValue(this.image.sprite, out e2DSprite))
        {
            var mat = E2DMatrix3x2.FromE2DImage(this, e2DSprite);
            return(string.Format("{{index = {0}, mat = {1}{2}}},\n", container.spriteIndexMap[this.image][this.image.sprite], mat, extraStr));
        }
        else
        {
            Debug.LogError("引用到不在图集内的Sprite:" + E2DHelper.PrintNodePath(node, root), this.image.sprite);
        }
        return("");
    }
Beispiel #2
0
    public override string ExportFrame(int index)
    {
        string extraStr;

        if (btn.image.color == Color.white)
        {
            extraStr = "";
        }
        else
        {
            extraStr = string.Format(" color={0}", btn.image.color.ToBGRA());
        }

        var mat = E2DMatrix3x2.FromE2DImage(this, this.e2DSprite);

        return(string.Format("{{index = {0}, touch = true, mat = {1},{2}}},\n", index, mat, extraStr));
    }