- Home /
Unity 4.3 How to load sprites from a sprite?
This is the way how to load Sprites from Resource:
Sprite[] sprites = Resources.LoadAll<Sprite>("UI/Textures/aPNGImage");
But I have a class, like this:
public class ClassA : MonoBehaviour {
public Sprite aSprite;
public void Start()
{
int count = this.Count(this.aSprite);
Debug.Log(count);
}
public int Count(Sprite aSprite)
{
//That's why I don't want to loadd sprites from Resources
//I just want to load sprites from some sprite I dragged from Inspector
return LoadAll<Sprite>(aSprite).Lenght;
//Is there any way can I load Sprites from object reference like this
}
}
Comment
Your answer
Follow this Question
Related Questions
How to rebuild Atlas manually? 1 Answer
If/Then Conditional Ignoring Usual Logic C# 0 Answers
Why does this sprite's normal map only light correctly from one direction? 2 Answers
Why some sprites in spritesheets are not visible in sprites but works fine in UI images? 0 Answers
How do i remove the parent spritesheet name in all sliced sprites? 0 Answers