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)); }
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; }
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)); }
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)); }
public Metadata(int format, SizeInt size, string textureFileName) { this.format = format; this.size = size; this.textureFileName = textureFileName; }