Hello guys,
I’m serializing a configuration file and loading it. The file is created just fine, and the AssetDatabase.LoadAssetAtPath() can retrieve it’s information. The problem is when I reopen Unity, AssetDatabase.LoadAssetAtPath() returns null. I use the code below to test the load of the asset.
[MenuItem("AssetTest/Test Load")]
static void TestLoadMenu()
{
CoreSettings core = CreateInstance<CoreSettings>();
UnityEngine.Object objecto = AssetDatabase.LoadAssetAtPath(API.CoreDataLocation, typeof(CoreSettings));
// Create the coreSettings asset.
core = AssetDatabase.LoadAssetAtPath(API.CoreDataLocation, typeof(CoreSettings)) as CoreSettings;
if (core == null)
Debug.Log("Test Load: Failed.");
else
Debug.Log("Test load:" + core.LaserLenght + "
");
}
Notice: I can also open it on Sublime or a text editor (with Unity closed) and all my information is there.
Any ideas why AssetDatabase.LoadAssetAtPath() is returning null?