Skip to content

Commit

Permalink
Merge branch 'release/0.3.1'
Browse files Browse the repository at this point in the history
Conflicts:
	Assets/UnitySpineImporter/Scripts/Editor/Util/SpineUtil.cs
  • Loading branch information
nicloay committed May 22, 2014
2 parents 4f2247d + 37e1a9c commit 0bf88cc
Showing 1 changed file with 22 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ public static SpineMultiatlas deserializeFromFile(string multiatlasFilePath){
throw new SpineMultiatlasCreationException("provided file does not exists");
using(StreamReader streamReader = new StreamReader(multiatlasFilePath)){
string line;
string spriteNameAfterProps = "";
bool setMainProps = false;
SpineAtlas spineAtlas = null;
SpineSprite sprite = null;
Expand All @@ -30,14 +31,30 @@ public static SpineMultiatlas deserializeFromFile(string multiatlasFilePath){
spineAtlas = new SpineAtlas();
multiAtlas.Add(spineAtlas);
spineAtlas.imageName = line;
spineAtlas.format = streamReader.ReadLine();
spineAtlas.filter = streamReader.ReadLine();
spineAtlas.repeat = streamReader.ReadLine();
Dictionary<string,string> keyValue = new Dictionary<string, string >();
string[] kvp;
while( (kvp= streamReader.ReadLine().Split(':')).Length == 2)
keyValue.Add(kvp[0].Trim(), kvp[1].Trim());

spineAtlas.format = keyValue["format"];
spineAtlas.filter = keyValue["filter"];
spineAtlas.repeat = keyValue["repeat"];

spriteNameAfterProps = kvp[0];
spineAtlas.sprites = new List<SpineSprite>();
setMainProps = false;
} else {

}

if (!setMainProps){
sprite = new SpineSprite();
sprite.name = line;

if (string.IsNullOrEmpty( spriteNameAfterProps)){
sprite.name = line;
} else {
sprite.name = spriteNameAfterProps;
spriteNameAfterProps = "";
}
try{
sprite.rotate = bool.Parse(streamReader.ReadLine().Split(':')[1]);
sprite.xy = SpineUtil.lineToVector2(streamReader.ReadLine());
Expand Down

0 comments on commit 0bf88cc

Please sign in to comment.