我正在尝试在我的 XNA 4.0 游戏中保存高分信息。他们的方式我已经阅读了如何使用 StorageContainer.TileLocation,这在 XNA 4.0 中显然不可用。 这是 SaveHighScores 方法
public static void SaveHighScores(HighScoreData data, string filename)
{
// Get the path of the save game
string fullpath = Path.Combine(StorageContainer.TitleLocation, filename);
// Open the file, creating it if necessary
FileStream stream = File.Open(fullpath, FileMode.OpenOrCreate);
try
{
// Convert the object to XML data and put it in the stream
XmlSerializer serializer = new XmlSerializer(typeof(HighScoreData));
serializer.Serialize(stream, data);
}
finally
{
// Close the file
stream.Close();
}
}
TitleLocation 给我一个错误,后来我发现它在 XNA 4.0 中不再可用
有什么方法可以在 XNA 4.0 中完成这项工作,如果不能,如何在 XNA 4.0 中完成而不是使用 StorageContainer.TitleLocation?
最佳答案
关于c# - 将 XNA 3.1 转换为 XNA 4.0。 StorageContainer.TileLocation,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13553552/