Why does Resources.Load return null?

2020-05-21 09:04发布

My project has multiple sprites located in Assets\Sprites which I want to load using C# script.

I have tested this:

Sprite myFruit = Resources.Load <Sprite> ("Graphics_3");

But myFruit is still null.

7条回答
一夜七次
2楼-- · 2020-05-21 09:40

Unity's scripting reference doesn't says that you need write <Sprite> right after Load. So I had problem with loading sprites, although my sprite was in Resources directory.

查看更多
登录 后发表回答