- Home /
This question was
closed Oct 22, 2014 at 12:14 PM by
thef1chesser for the following reason:
Other
Question by
thef1chesser · Oct 22, 2014 at 12:00 PM ·
c#materialloadresources
Resources.Load doesn't load my materials
I am trying to load in several materials at the scene start so it doesn't have to load these every update they're needed. so this is directly in void Start()
materials = new Material[2];
materials[0] = Resources.Load<Material>("Materials/Material1");
materials[1] = Resources.Load<Material>("Materials/Material2");
Debug.Log(materials[0].name);
However to me this seems like it is described http://docs.unity3d.com/ScriptReference/Resources.Load.html yet I only get a NullReferenceException since nothing is being loaded in the material array.
I've checked if the naming was in anyway incorrect but they are the same. I'm confused.
Comment
Follow this Question
Related Questions
Multiple Cars not working 1 Answer
Distribute terrain in zones 3 Answers
Material Resource will not load when Resources.Load is called 2 Answers
Load files from resource 1 Answer
Assigning script-generated textures 0 Answers