- Home /
Question by
axeldillstrom · Jul 22, 2020 at 11:31 AM ·
spritesheetresources.loadall
How to access sliced sprites?
Hello. I'm trying to set the pixels of a tile to the pixels of a sprite. I have a sliced spritesheet called "lofiEnvironment2" in the Resources folder.
I can't drag the child sprites to inspector.
I have tried using Resources.LoadAll that seemed to work for everyone else a few years ago:
private Sprite[] sprites;
void Start()
{
sprites = Resources.LoadAll<Sprite>("lofiEnvironment2");
print(sprites.Length); // 0
I have no idea what to try anymore. I can't find any solutions to the problem.
Comment
maybe you just need to serialize it? [SerializedField] private Sprite[] sprites;