public static LevelData LoadFromFile(int zone, int level) { string levelFilePath = LevelUtils.GetPathForLevelLoad(zone, level); TextAsset textAsset = (TextAsset)Resources.Load(levelFilePath, typeof(TextAsset)); XmlSerializer serializer = new XmlSerializer(typeof(LevelData)); StringReader stream = new StringReader(textAsset.text); LevelData data = serializer.Deserialize(stream) as LevelData; stream.Close(); return(data); }