Hello there.
Since some patch, I can’t write anything on the Application.persistantDataPath folder. My system worked well until something went horribly wrong somewhere.
In the player setting, the Install Location is set to internal, the Write Access to External (SD Card).
When I use logcat, the save location is /storage/emulated/0/Android/data/com.mycompany.mygame/files/
I don’t have any Manifest.xml in the Assets/Plugins/Android/
The code I use to write stuff is this one :
public static void Write(string filename, string content)
{
if(Application.platform == RuntimePlatform.Android)
{
filename = Path.Combine(Application.persistentDataPath, filename);
}
string directory = Path.GetDirectoryName(filename);
Debug.Log (directory);
if(!Directory.Exists(directory))
{
Directory.CreateDirectory(directory);
}
FileStream file = File.Open(filename, FileMode.CreateNew);
StreamWriter sw = new StreamWriter(file);
sw.Write(content);
sw.Close();
file.Close();
}
And I can’t figure out what’s missing…
I’m using Unity 4.6.2p1