2D Toolkit Forum
2D Toolkit => Support => Topic started by: Euthyphro on December 11, 2014, 09:18:58 pm
-
The sprites on one of my sprite sheets randomly come out like this image rather than the actual sprite:
(http://i.imgur.com/n8qz9hb.jpg)
This doesn't happen every time. I'm trying to pull out a random sprite with the following code added to t2dSpriteCollectionData which returns "blank" values:
public string GetRandomSpriteName()
{
return spriteDefinitions[Random.Range(0, spriteDefinitions.Length)].name;
}
Any suggestions on why this would return a value most of the time but the odd time it is an empty string? In the collection, every sprite has a name and yet this sometimes returns an empty string.
-
Deleted sprites are not removed from the list, just replaced with an empty one. You will need to run through the list and find Valid ones.