Есть следуюший код для чтения файла:
public void readPurchase(){
string path;
#if UNITY_EDITOR
path = "/StreamingAssets/purchase.json";
#elif UNITY_ANDROID
path = "jar:file://" + Application.dataPath + "!/assets/purchase.json";
#endif
StartCoroutine (jsonReadCorout(path));
string json = File.ReadAllText(Application.dataPath + path);
itemsContent = JsonUtility.FromJson<Main> (json);
bundleForPing = itemsContent.bundleID;
}
IEnumerator jsonReadCorout(string path){
WWW www = new WWW(path);
yield return www;
{
Debug.LogError ("Can't read");
}
}
файл находится в папке StreamingAssets, у меня не правильный путь к нему но не могу понять где ошибка.