Dear all,
I am working on a solution to change game settings like used prefabs, materials during runtime. I implemented a gamestate object which will not be deleted between scene change.
At start time of this object, the content is loaded from resource folder.
try
{
...
tmpDesign.mat1 = Resources.Load("Materials/Blue/mat1", typeof(Material)) as Material;
...
}
catch(Exception e)
{
// Something went wrong, so lets get information about it.
Debug.Log(e.ToString());
}
Because I am not sure I will forget something to move to the resource folder or rename a resource I want to be sure everything is loaded correctly and found.
A simple test with a wrong filename shows that resources.load doesn’t throw any exception if file not found.
Do i have to check every return value for resources.load ??
Greetings
Pat