//saving works completely fine. I can see the file in the file system.
Code: Select all
ES2.Save<GameLevelData>(data, "local_levels/someFileName");
//no errors
Code: Select all
GameLevelData a = ES2.Load<GameLevelData>("local_levels/someFileName");
Code: Select all
var a = ES2.LoadArray<GameLevelData>("local_levels");
var b = ES2.LoadAll("local_levels");
UnauthorizedAccessException: Access to the path 'C:/Users/someuser/AppData/LocalLow/DefaultCompany/GameName/local_levels' is denied.
System.IO.FileStream..ctor (System.String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize, Boolean anonymous, FileOptions options) (at /Users/builduser/buildslave/mono/build/mcs/class/corlib/System.IO/FileStream.cs:259)
System.IO.FileStream..ctor (System.String path, FileMode mode, FileAccess access, FileShare share)
(wrapper remoting-invoke-with-check) System.IO.FileStream:.ctor (string,System.IO.FileMode,System.IO.FileAccess,System.IO.FileShare)
System.IO.File.OpenRead (System.String path) (at /Users/builduser/buildslave/mono/build/mcs/class/corlib/System.IO/File.cs:363)
System.IO.File.ReadAllBytes (System.String path) (at /Users/builduser/buildslave/mono/build/mcs/class/corlib/System.IO/File.cs:538)
ES2FileUtility.ReadAllBytes (System.String path)
ES2FileStream.CreateReadStream ()
ES2FileStream..ctor (.ES2Settings settings, Operation operation)
ES2Stream.Create (.ES2Settings settings, Operation operation)
ES2Reader..ctor (.ES2Settings settings)
ES2Reader.Create (.ES2Settings settings)
ES2.LoadArray[GameLevelData] (System.String identifier)
//Some method calls from my own code base go here
My game basically has a level editor in it. All levels players save go into the same directory.
I want a level selection screen to be able to load all of the levels I saved in the "local_levels" directory into an array of GameLevelData objects.
Am I trying to load directories in the wrong way?
Thanks in advance!