示例#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);
 }
示例#2
0
 void Start()
 {
     Screen.orientation = ScreenOrientation.LandscapeLeft;
     if (SerializedEntities.se == null)
     {
         SerializedEntities.se     = SerializedEntities.DeSerialize(Constants.EntitiesXML);
         SerializedScenes.szScenes = SerializedScenes.DeSerialize(Constants.ScenesXML);
     }
     gl.Initialize();
 }
示例#3
0
        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);
        }