Comments and answers for "Trying to load high scores... Game is ignoring the defined directory and looking where the .exe is...? Please help"http://answers.unity.com/questions/1436712/trying-to-load-high-scores-game-is-ignoring-the-de.html
The latest comments and answers for the question "Trying to load high scores... Game is ignoring the defined directory and looking where the .exe is...? Please help"Answer by Iarushttp://answers.unity.com/answers/1436740/view.html
Debug your game and see what file.ToString() returns.
I suppose that file.ToString() returns the same thing as file.Filename. Since it's just a filename, Unity thinks you're giving it a relative path, so it looks relatively to the current working directory (where the .exe is).
You might want to use file.AbsolutePath. I don't know the exact name of the property, look at the doc if it doesn't compile.Wed, 29 Nov 2017 17:28:52 GMTIarusAnswer by Multirezonatorhttp://answers.unity.com/answers/1436719/view.html
Use relative paths:
// load
string _directoryPath = "Scores";
if (!Directory.Exists(_directoryPath))
Directory.CreateDirectory(_directoryPath);
DirectoryInfo info = new DirectoryInfo(_directoryPath);
// your code here..
You also can use PlayerPrefs to store scores for support more platforms.
[https://docs.unity3d.com/ScriptReference/PlayerPrefs.html][1]
[1]: https://docs.unity3d.com/ScriptReference/PlayerPrefs.htmlWed, 29 Nov 2017 16:23:07 GMTMultirezonator