- Home /
Question by
unity_iUxtoa6jmqRAAA · Dec 02, 2018 at 11:42 PM ·
androidapk
Save an array to file android
Hi everyone, I have this code, and I can save this array on PC but when I try on my android phone it does not work, anyone could help?
public class SavePlayerGame : MonoBehaviour { private string gameDataProjectFilePath = "/Resources/playerInformation.json";
public void SaveGameData()
{
PlayerSavedData aux = new PlayerSavedData();
aux.allSavedPlayerData = SavePlayerInformation.playerDataList.ToArray<PlayerData> ();
string dataAsJson = JsonUtility.ToJson (aux);
string filePath = Application.dataPath + gameDataProjectFilePath;
File.WriteAllText (filePath, dataAsJson);
SendEmail(dataAsJson);
}
}
Comment
Your answer
Follow this Question
Related Questions
Graphic resources size in builds 0 Answers
Error building Player: Exception: apk 0 Answers
Run on Android without installing APK 0 Answers