コード例 #1
0
        protected override Metadata CreateMetadata(PlistElementDict pd)
        {
            int     format          = pd["format"].AsInteger();
            SizeInt size            = Util.StringToSizeInt(pd["size"].AsString());
            string  textureFileName = pd["textureFileName"].AsString();

            return(new Metadata(format, size, textureFileName));
        }
コード例 #2
0
ファイル: Models.cs プロジェクト: dotlive/TextureUnpacker
 public Frame(string textureName, Vector2Int startPos, SizeInt size, SizeInt sourceSize, bool isRotated, Vector2Int offset)
 {
     this.textureName = textureName;
     this.startPos    = startPos;
     this.size        = size;
     this.sourceSize  = sourceSize;
     this.isRotated   = isRotated;
     this.offset      = offset;
 }
コード例 #3
0
        protected override Frame CreateFrame(string textureName, PlistElementDict pd)
        {
            Vector2Int startPos   = Util.StringToRectInt(pd["textureRect"].AsString()).position;
            SizeInt    size       = Util.StringToSizeInt(pd["spriteSize"].AsString()); //也可使用textureRect中的数据
            SizeInt    sourceSize = Util.StringToSizeInt(pd["spriteSourceSize"].AsString());
            bool       isRotated  = pd["textureRotated"].AsBoolean();
            Vector2Int offset     = Util.StringToVector2Int(pd["spriteOffset"].AsString());

            return(new Frame(textureName, startPos, size, sourceSize, isRotated, offset));
        }
コード例 #4
0
        protected override Frame CreateFrame(string textureName, PlistElementDict pd)
        {
            Vector2Int startPos   = Util.StringToRectInt(pd["frame"].AsString()).position;
            SizeInt    size       = new SizeInt(Util.StringToRectInt(pd["sourceColorRect"].AsString()).size);
            SizeInt    sourceSize = Util.StringToSizeInt(pd["sourceSize"].AsString());
            bool       isRotated  = pd["rotated"].AsBoolean();
            Vector2Int offset     = Util.StringToVector2Int(pd["offset"].AsString());

            return(new Frame(textureName, startPos, size, sourceSize, isRotated, offset));
        }
コード例 #5
0
ファイル: Models.cs プロジェクト: dotlive/TextureUnpacker
 public Metadata(int format, SizeInt size, string textureFileName)
 {
     this.format          = format;
     this.size            = size;
     this.textureFileName = textureFileName;
 }