- Home /
Question by
flaxibitz · Aug 11, 2021 at 11:34 AM ·
androidxmlxmlserializer
I have a quiz game that loads questions using an xml file. The game works well on editor,but not on android.Help Pls
void LoadData ()
{
if (Application.platform == RuntimePlatform.Android)
{
var path = Path.Combine("jar:file://" + Application.dataPath + "!/assets/", "Q1.xml");
var www = new WWW(path);
if (!string.IsNullOrEmpty(www.error)) { UnityEngine.Debug.LogError("Cant read file");}
else{
while (!www.isDone){}
}
File.WriteAllBytes(path, www.bytes);
path = www.text;
Debug.Log(path);
data = Data.Fetch(path);
}
else
{
var path = Path.Combine(GameUtility.fileDir, "Resources\\", "Q1.xml" );
Debug.Log(path);
data = Data.Fetch(path);
}
}
Kindly note that i have both a streamingAssets and Resources folders and have tried reading from both folders to no avail. The else part of the above code works pretty fine. I need help with the android part. Also, kindly suggest an ios version that will work. Please, help with something you've used recently. @unity3d, @unity, @admin
Comment