EDIT:
I made it work with the following code:
Code: Select all
public List<T> LoadFilesAtPath<T>(string _strPath) where T : ScriptableObject
{
List<T> liFiles = new List<T>();
string[] arFileNames = ES3.GetFiles(_strPath);
for (int i = 0; i < arFileNames.Length; i++)
{
byte[] arFileAsBytes = ES3.LoadRawBytes(Path.Combine(_strPath, arFileNames[i]));
//T file = ES3.Deserialize<T>(arFileAsBytes);
T file = ScriptableObject.CreateInstance<T>();
ES3.DeserializeInto(arFileAsBytes, file);
if (file != null) liFiles.Add(file);
}
return liFiles;
}