I am attempting to load a created ScriptableObject. The file gets placed correctly, and exists in a folder under /Resources/, as it is supposed to.
However, when it is actually loaded via Resources.Load, it returns a Null - even though a System.IO.File.Exists says that the path is valid - and that the file is actually correct. This is what handles the file load. All of the correct variables show up in Inspector and looking at the file in a text editor:
public void loadLevel(string fileName)
{
// Path - Valid: Assets/GameAssets/Resources/Levels
string filePath = fileDirectory + fileName;
if (System.IO.File.Exists(filePath + ".asset")) // The file does exist, and has content;
{
// Scriptable Object //
Level tempLvl = Resources.Load<Level>(filePath); // No ".asset" on actual name
// Returns Null!
}
}
Can anyone tell me what might be going on here? I did one final test - moving everything directly into Resources, but it returned the same result.
Here is a example of a file that I’m attempting to load - so it’s not actually null: