I have a Json.I can not access this json on the phone.It does not work android phone?What is the wrong ?My json is in the StreamingAssets folder
IEnumerator loadStreamingAsset(string fileName1)
{
string filePath1 = "jar:file://" + Application.dataPath + "!/assets/"+fileName1;
string result1;
if (filePath1.Contains("://"))
{
UnityWebRequest myWr = UnityWebRequest.Get(filePath1);
yield return myWr.SendWebRequest();
result1 = myWr.downloadHandler.text;
OneJsonData = JsonMapper.ToObject(result1);
}
else
{
result1 = System.IO.File.ReadAllText(filePath1);
OneJsonData = JsonMapper.ToObject(result1);
}
Debug.Log("Loaded file: " + result1);
}
StartCoroutine(loadStreamingAsset("jsonname.json"));