I have a number of png files which I am importing using C# (in Unity 5.3.5) and setting them to the sprite of an image. However, for only some of these files, Resources.Load gives me 'null' when this code is executed.
Resources.Load<Sprite>(@"Instruction_Files/1");
As a specific example, the first image I will upload (7.png) gives me the Sprite when I call
Resources.Load<Sprite>(@"Instruction_Files/7");
In contrast, the second image I will upload (10.png) gives me null when I call
Resources.Load<Sprite>(@"Instruction_Files/10");
Renaming 10.png to 7.png, etc. and vice versa doesn't change things (the original 10.png will be null and the original 7.png won't be).
Is there a specific format that Sprite files need to be (e.g. square, a certain number of kB) for Resources.Load to work? Any potential method to solve this issue? Thanks.
UPDATE: Importantly, if I copy all the information in the 7.png.meta file and paste it in the 10.png.meta file, then 10 is registered as a sprite
Debug.Log(Resources.Load<Sprite>(@"Instruction_Files/10"))
I get 'null' for 10.png or Sprite(....) for 7.png. – Jack Walsh