2D Toolkit Forum
2D Toolkit => Support => Topic started by: Benny on November 21, 2013, 01:41:19 pm
-
After I updated to 2.6.0, multiple materials for a single sprite collection is not working. When hitting 'commit' to generate sprites data, all material indices of sprites will be reset to 0.
So I traced down to source code of tk2d, and found something weird.
File: tk2dSpriteCollectionBuilder.cs
Line: 1910
// make sure its not overrun, can happen when refs are cleared
thisTexParam.materialId = Mathf.Min( thisTexParam.materialId, gen.atlasMaterials.Length - 1);
coll.spriteDefinitions[i].material = gen.altMaterials[thisTexParam.materialId];
coll.spriteDefinitions[i].materialId = thisTexParam.materialId;
First line uses altlasMaterial to clamp material id, I suppose this is what is causing the bug. I changed it to altMaterials, and it seems back to work.
Am I correct?
-
Yes it is, sorry I haven't got around to issuing a fix yet. I'm waiting on one last fix before I do that.
http://2dtoolkit.com/forum/index.php/topic,3092.0.html