public void Initialize() { Screen.orientation = ScreenOrientation.LandscapeLeft; SerializedEntities.se = SerializedEntities.DeSerialize(Constants.EntitiesXML); SerializedScenes.szScenes = SerializedScenes.DeSerialize(Constants.ScenesXML); SerializedMapCategories.mapCategories = SerializedMapCategories.DeSerialize(Constants.CategoriesXML); SerializedGameLevels.gameLevels = SerializedGameLevels.DeSerialize(Constants.GameLevelsXML); }
void Start() { Screen.orientation = ScreenOrientation.LandscapeLeft; if (SerializedEntities.se == null) { SerializedEntities.se = SerializedEntities.DeSerialize(Constants.EntitiesXML); SerializedScenes.szScenes = SerializedScenes.DeSerialize(Constants.ScenesXML); } gl.Initialize(); }
public static SerializedScenes DeSerialize(string filename) { XmlSerializer deserializer = new XmlSerializer(typeof(SerializedScenes)); TextAsset textAsset = (TextAsset)Resources.Load(filename); TextReader textReader = new StringReader(textAsset.text); SerializedScenes sz = (SerializedScenes)deserializer.Deserialize(textReader); textReader.Close(); return(sz); }