I am trying to get a list of all sprite names in a Sprite Collection during runtime. I put the data file in Resources folder, and then try to get all the names by code:
tk2dSpriteCollectionData atlas = Resources.Load("atlas", typeof(tk2dSpriteCollectionData)) as tk2dSpriteCollectionData;
foreach (tk2dSpriteDefinition spritedefinition in atlas.spriteDefinitions) {
Debug.Log(spritedefinition.name);
}
The weird thing is that it works for one Sprite Collection, and not the other. The other Sprite Collection is showing 0 spriteDefinitions count.
I checked and the only difference between the two Sprite Collection is that the one returning 0 has 3 platforms (@1x, @2x, @4x)
Any help will be appreciated. Thanks!