- Home /
Resources.loadall not loading prefabs at runtime.
Hi,
I am creating an editor to help speed up development. I have a resources folder that is split into /models and /textures. In editor it loads all the textures and the prefabs in there respective folders. At runtime it only loads the textures. The only difference I can see is that the textures are .png and the prefabs are .prefab.
this is the code I am using to load the assets.
void loadModels()
{
models = Resources.LoadAll("Models");
}
void loadTextures()
{
textures = Resources.LoadAll("Textures");
}
These are called in the void Start() function. "models" and "textures" are both Object[] arrays.
Just to add to this I am aware this was an issue in earlier builds but I understand this was fixed? I am using the current stable build of unity.
Answer by Cunnah · Aug 03, 2016 at 01:24 PM
Well after some debugging it turns out that this isn't the issue instead my buttons aren't being shown... this is probably something wrong with my UI.
The models are being loaded.
Your answer
Follow this Question
Related Questions
About to gut my use of the Resources folder. What are the best practices going forward? 1 Answer
how Load Prefabs after build 0 Answers
Altering prefab at runtime. Works in editor, not in build. 2 Answers
Have some strange problem with Resources.Load 1 Answer
Creating prefab by script and using it crashes unity 0 Answers