Exemple #1
0
 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);
 }
        public static SerializedMapCategories DeSerialize(string filename)
        {
            XmlSerializer deserializer = new XmlSerializer(typeof(SerializedMapCategories));

            TextAsset  textAsset       = (TextAsset)Resources.Load(filename);
            TextReader textReader      = new StringReader(textAsset.text);
            SerializedMapCategories sz = (SerializedMapCategories)deserializer.Deserialize(textReader);

            textReader.Close();

            foreach (MapCategory mc in sz.categories)
            {
                mc.Initialize();
            }

            return(sz);
        }