Итак, у меня есть этот код, и мои вопросы не хранятся ни в одной папке.Это просто там в активах.И проблема в том, что когда я создаю приложение и открываю его с любого телефона Android, вопросы не отображаются.Извините за мой английский.
using System.IO;
using System.Xml.Serialization;
using UnityEngine;
public class GameUtility {
public const float ResolutionDelayTime = 1;
public const string SavePrefKey = "Game_Highscore_Value";
public const string FileName = "Q";
//file name is upthere and the dir down
public static string FileDir
{
get
{
return Application.dataPath + "/";
}
}
}
//this gives me a new question
[System.Serializable()]
public class Data
{
public Question[] Questions = new Question[0];
public Data () { }
public static void Write(Data data, string path)
{
XmlSerializer serializer = new XmlSerializer(typeof(Data));
using (Stream stream = new FileStream(path, FileMode.Create))
{
serializer.Serialize(stream, data);
}
}
public static Data Fetch(string filePath)
{
return Fetch(out bool result, filePath);
}
public static Data Fetch(out bool result, string filePath)
{
if (!File.Exists(filePath)) { result = false; return new Data(); }
XmlSerializer deserializer = new XmlSerializer(typeof(Data));
using (Stream stream = new FileStream(filePath, FileMode.Open))
{
var data = (Data)deserializer.Deserialize(stream);
result = true;
return data;
}
}
}
Я просто хочу знать, почему мое приложение не отображает мои вопросы с Android?На ПК работает притыть нормально.