Hello. I am trying to load sprites into a dictionary. I am trying to use Resources.Load to load my sprites into my dictionary. Code is as follows:
for (int i = 0; i < 60; i++)
{
if (i < 10)
{
loadNumber = ("0" + i).ToString();
newSprite = Resources.Load(("Assets/Sprites/sprite_" + loadNumber));
spriteDictionary.Add(i, newSprite);
}else
{
loadNumber = i.ToString();
newSprite = Resources.Load(("Assets/Sprites/sprite_" + loadNumber));
spriteDictionary.Add(i, newSprite);
}
}
The thing is, my sprite PNG files are loading as gameobjects. I want them loaded as sprites. How do I do this?